Accessing Linq data in telerik grid ItemCreated method

Posted by Jack on Stack Overflow See other posts from Stack Overflow or by Jack
Published on 2010-05-17T01:09:00Z Indexed on 2010/05/17 1:10 UTC
Read the original article Hit count: 301

Filed under:
|
|
|
|

Not sure if the title of this question makes sense, but here's my problem:

I have a telerik grid bound to a Linq data object, however, I limit the fields returned:

<IQueryable>filter = data.Select(x => new {x.ID, x.Name, x.Age});

I would like to access these fields in the ItemCreated method of the grid:

protected void rgPeople_ItemCreated(object sender, GridItemEventArgs e)
{
  Telerik.Web.UI.GridDataItem item = (GridDataItem)e.Item;
  ?????? Person = (???????)e.Item.DataItem;
}

What do I declare ?????? as so that I can use:

String ID = Person.ID;
String Name = Person.Name; etc

© Stack Overflow or respective owner

Related posts about telerik

Related posts about LINQ