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

How do i get the sorted/filtered results from a RadGridView as IEnumerable<T>

1 Answer 171 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 15 Oct 2014, 10:04 AM
Hello,

I need the filtered and sorted results from a RadGridView Control. RadGridView.Items contains the sorted/filtered/etc. data as DataItemCollection but I wonder if I could get the results as IEnumerable<T> and not as DataItemCollection. I need to have this because I am bound to a specific API.

I know I could cast it using RadGridView.Items.Cast<SpecificType>(); but I do not know the specific type because it is determined at runtime.

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Boris
Telerik team
answered on 15 Oct 2014, 04:07 PM
Hello Joel,

In cases where you are not entirely sure what is your data type, you can consider casting to object like so:

IEnumerable<object> items = this.clubsGrid.Items.Cast<object>();

I hope this helps.

Regards,
Boris Penev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Tim
Top achievements
Rank 1
Answers by
Boris
Telerik team
Share this question
or