Intersoft WebGrid Documentation
How-to: Open a new window that contains details of a selected row using OnButtonClick
See Also Send comments on this topic.

Glossary Item Box

This walkthrough will show you how to use OnButtonClick client side event.

In this topic, you will learn the basic thing on how to display the selected row's details using OnButtonClick.

To display the selected row's details using OnButtonClick

  1. Select WebGrid's instance and press F4.
  2. In Layout Settings, select ClientSideEvents, then set OnButtonClick to MyOpen.
  3. Write this function in OnButtonClick client side event:

    JavaScript Copy ImageCopy Code
    function MyOpen()
    {
      window.open("NewPage.aspx",null,"height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
    }
    

  4. Create a new page and named it "NewPage.aspx".
  5. On Window onload client side events, write the following function:

    JavaScript Copy ImageCopy Code
    function window::onload()
    {
      var grid = window.opener.ISGetObject("WebGrid1");
      var row = grid.GetSelectedObject().ToRowObject();
      var cell = row.GetCells();
      Label1.innerText = cell[3].Text;
      Label2.innerText = cell[4].Text;       
    }
    

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.