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

RadGrid - ItemDataBound issue when grouping

2 Answers 161 Views
Grid
This is a migrated thread and some comments may be shown as answers.
franchute
Top achievements
Rank 1
franchute asked on 06 Feb 2008, 12:18 PM
Hi guys, I'm having the following issue when trying to group my radgrid control.
On the itemdatabound event I did not find a way to make reference to a column of any particular row using the name of the column.
The GridItemEventArgs class only brings me the chance to use e.Item.Cells[index] to get the column value, e.Item.Cells[3] for instance. However, when grouping my grid the e.item.Cells[3] is no longer there so I need a way to reach the column by name instead of doing this by index (integer). Something like e.item.Cells["ColumnName"]
Is there any way to carry out this functionality ??

Thanks,

François.

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 06 Feb 2008, 12:20 PM
Hello François,

Here is an example how to achieve this:

if(e.Item is GridDataItem)
{
    TableCell cell = ((GridDataItem)e.Item)[YourColumnUniqueName];
}

Greetings,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
franchute
Top achievements
Rank 1
answered on 06 Feb 2008, 12:26 PM
Thank you Vlad for your answer.

Kind regards,

François
Tags
Grid
Asked by
franchute
Top achievements
Rank 1
Answers by
Vlad
Telerik team
franchute
Top achievements
Rank 1
Share this question
or