This walkthrough will show you how to use OnCellSelect client side event.
In this topic, you will learn the basic thing on how to display the selected cell's text using OnCellSelect.
To display the selected cell's text in WebGrid
- Select WebGrid's instance and press F4.
- In Layout Settings, select ClientSideEvents, then set OnCellSelect to WebGrid1_OnCellSelect.
- Write the following function in OnCellSelect client side event:
JavaScript Copy Code function WebGrid1_OnCellSelect(controlId, tblName, rowIndex, cellIndex) { var WebGrid1 = ISGetObject(controlId); var selObj = WebGrid1.GetSelectedObject().GetRowElement(); var cell = selObj.cells[cellIndex+1].innerText; alert(cell); return true; }
- Run the project.
References
OnCellSelect Property
Other Resources
Walkthrough Topics
How-to Topics