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

Consume an Anon DataType in ItemDataBound

1 Answer 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Veteran
sitefinitysteve asked on 11 Aug 2010, 03:37 PM
I bind the Grid with an Anon DataType...

So how do I consume those columns in itemDataBound?  I SEE the columns in debug...just cant get at the properties

GridDataItem item = e.Item as GridDataItem;
 
var data = item.DataItem;


1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Aug 2010, 07:23 AM
Hello Steve,

You can loop through each columns and get the ColumnUniqueName. Then based on that ColumnUniqueName access the cell value as described in the documentation.

C#:
foreach (GridColumn col in RadGrid1.Columns)
 {
    if (col.UniqueName == "")// Check with ColumnUniqueName
      {
         .....
      }
 }

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