Intersoft WebGrid Documentation
Retrieve Parent KeyValue
See Also Send comments on this topic.
Intersoft WebGrid > Learning More > Working with ChildTables > Retrieve Parent KeyValue

Glossary Item Box

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 CopyHover ImageCopy 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 CopyHover ImageCopy Code
var keyValue = parentRow.KeyValue;     
                
When you run the application, select a child row to obtain the parent row's key value.

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.