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

get a list of all items in the datasource

1 Answer 224 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 19 Mar 2014, 08:34 AM
Hello,

Here is my scenario. I have a grid populated by an ajax call.
The grid may or may not be paginated.
The user can apply filters, sorts, whatever.
I need to be able to get a list of all the rows in the grid ( not just on the visible page ).
Basically an export of the state of the grid taking into consideration all the user actions.

What's the best way to do this ?

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 20 Mar 2014, 07:20 AM
Hello Stuart,

Every data bound widget (including the Grid) uses DataSource::view() method. This returns already processed data, i.e filtered/sorted/grouped/paged etc. and treat it as-is.

If you need all the data available in the data source you should use DataSource::data() method. When using this method you should have few things in mind:
 - if serverPaging: true is configured - it will hold already paged data on the remote resource, i.e not all items available on your data store (DB for example).
 - if serverFiltering: true is configured - it will hold already filtered data
and the list goes the same for the other server processing options: serverGrouping/serverSorting etc.


Regards,
Nikolay Rusev
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
Grid
Asked by
Shaun
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or