In hierarchical grid scenario, we can get parent row's KeyValue from child table.
This topic will show you how to obtain parent's row KeyValue.
To obtain parent row's KeyValue in WebGrid
- Drag WebGrid instance into the WebForm.
- Add a client side function on your code.
- You can obtain parent's row KeyValue by simply using:
-
JavaScript Copy Code function GetParentRow()
{
var grid = ISGetObject("WebGrid1");
var selObj = grid.GetSelectedObject();
var row = selObj.GetRowObject();
if (row.Table.IsRootTable)
alert("Please select a child row");
else
{
var parentRow = row.GetParentRow(); // get the parent row of this child
alert("The parent row of this order is: " + parentRow.KeyValue);
}
}
Other Resources
Walkthrough Topics
How-to Topics