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

Datakeyvalue

1 Answer 65 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Tina
Top achievements
Rank 1
Tina asked on 25 Oct 2011, 02:26 AM
Hello,

I have an inner grid in nestedviewtemplate.how to access this value in itemdatabound of inner grid

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Oct 2011, 04:30 AM
Hello Tina,

Here is the sample code to access the DataKeyValue in ItemDataBound event.
C#:
protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
{
  if (e.Item is GridDataItem)
  {
    RadGrid innergrid = (RadGrid)sender;
    GridNestedViewItem nesteditem = (GridNestedViewItem)innergrid.NamingContainer;
    GridDataItem parentItem = (GridDataItem)nesteditem.ParentItem;
    string Id = parentItem.GetDataKeyValue("ID").ToString();
  }
}

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