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
- Select WebGrid's instance and press F4.
- In Layout Settings, select ClientSideEvents, then set OnRowSelect to WebGrid1_OnRowSelect.
- Write the following function in OnRowSelect client side event:
JavaScript Copy 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; }
- Run the project.
Other Resources
Walkthrough Topics
How-to Topics