Intersoft WebGrid Documentation
How-to: Get KeyValue of selected row using OnRowSelect
See Also Send comments on this topic.

Glossary Item Box

This walkthrough shows you how to use OnRowSelect client side event.

In this topic, you will learn the basic thing on how to get KeyValue of selected row using OnRowSelect.

To get KeyValue of selected row using OnRowSelect

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

    JavaScript Copy ImageCopy Code
    function WebGrid1_OnRowSelect(controlId, tblName, rowIndex, rowEl)
    {
       var WebGrid1 = ISGetObject(controlId);
       var row = WebGrid1.GetSelectedObject().GetRowObject();
       var key = row.KeyValue;
       alert(key);
       return true;
    }
    

  4. Run the project.

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.