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

[Solved] Determine Level of Hierarchy Grid

1 Answer 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 11 Mar 2013, 08:15 PM
Within a function I am iterating through the GridDataItems of an instance of the GridDataItemCollection and I need to determine the level within the hierarchy.

How can I determine what level of the hierarchy a GridDataItem or the GridDataItemCollection belongs to?

Thanks

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Mar 2013, 04:45 AM
Hi,

In order to identify the table to which the current row belongs/is bound (in the ItemCreated/ItemDataBound handler), you can utilize the Name property of each GridTableView.
C#:
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    //identify to which table belongs the currently bound item
    if (e.Item.OwnerTableView.Name == "DetailTableName")
    {
        
    }
}

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