WebGrid Preview Row's text can be obtained in client side.
In this topic, you will learn how to get the preview row text in WebGrid.
To get Preview Row's text in WebGrid
- Drag WebGrid to your form and bind it .
- Specify the PreviewRow settings in the grid.
- Create a function at the client side and use following code.
-
JavaScript Copy Code var grid = ISGetObject("WebGrid1"); var selRow = grid.GetSelectedObject().GetRowObject(); var rootRow = wgGetRootRow(selRow); alert(rootRow.keyValue); // return "2"; var prRow = wgGetPreviewRow(rootRow); var prCell = wgGetPreviewRowCell(prRow); alert(prCell.innerText);
- Run the project.
Tasks
Walkthrough: Using Preview Row in WebGrid
Concepts
Preview Row
References
PreviewRowSettings Class
Other Resources
Walkthrough Topics
How-to Topics