This is a migrated thread and some comments may be shown as answers.

data key value of the parent radgrid

1 Answer 203 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Savyo
Top achievements
Rank 1
Savyo asked on 07 Aug 2012, 12:55 PM
Hi there,

     I need the data key value of the parent radgrid in the itemdatabound event of the child grid which is inside nestedgeviewtemplate
Savyo

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 Aug 2012, 01:02 PM
Hi,

Try the following code to access datakeyvalue in ItemDataBound event of the inner grid.
C#:
protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
{
    RadGrid grid = (RadGrid)sender;
    GridNestedViewItem item = (GridNestedViewItem)grid.NamingContainer;
    GridDataItem data = (GridDataItem)item.ParentItem;
    string value = data.GetDataKeyValue("ID").ToString();
}

Thanks,
Princy.
Tags
Grid
Asked by
Savyo
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or