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

Grid Sorting

1 Answer 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dave Hollen
Top achievements
Rank 1
Dave Hollen asked on 21 Sep 2010, 10:14 PM
Hello,

I am using a Radgrid to display some data that I am returning via Linq.  The procedure running the Linq statement returns the data as an IList<ActivityAssociation> (where ActivityAssociation is the type).  This IList contains data from several different tables.

I want to allow the user to sort the data on the radgrid.  I have no problem displaying the data, but if I use the IList as the DataSource, I cannot sort the data without errors being thrown.

If I traverse the IList, the properties I get are things such as ActivityAssociation.ActivityId, ActivityAssociation.PERSON.PERSON_NAME, etc.  I can set the DataField to "ActivityId" as well as "PERSON.PERSON_NAME" and display the data fine, but if I set the Sort Expression to "PERSON.PERSON_NAME", it claims that it cannot find the column whenever I try to sort and rebind the table.  I even re-generate the IList prior to rebinding.

I was able to get around this by looping through the IList and creating a DataTable to use as the grid's datasource, but this is not the optimal solution as the amount of data returned could be large.

Does anybody have any suggestions?

Thanks,
Dave


1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 25 Sep 2010, 08:26 AM
Hi Dave,

Check the solution provided here and see if it works for you.

All the best,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Dave Hollen
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or