In hierarchical WebGrid, we often need to get the parent row's key value of a child row in client side. With the new enhancement in client side API, we can easily retrieve the key value.
First, we need to get the parent row. You can use this command to get the parent row:
JavaScript | Copy Code |
var grid = ISGetObject("WebGrid1"); var selObj = grid.GetSelectedObject(); var row = selObj.GetRowObject(); var parentRow = row.GetParentRow(); |
Then, you simply use this command to get the parent row's key value.
JavaScript | Copy Code |
var keyValue = parentRow.KeyValue; |
Overview
Getting Started
WebGrid Features Overview
Other Resources
Walkthrough Topics
How-to Topics