I have a radgrid in default.aspx page. I want show some data in radgrid with paging. But I dont have the whole datasource at the Need_DataSource event. My backend is like, passing the pagecount and the service will return only 100 records of the Nth page. I dont know the approximate total rows count. How do I achieve paging in radgrid without having the whole datasource and total rows count?
Please guide me.
6 Answers, 1 is accepted
One suggestion is you can use CustomPaging which allows you to fetch only a fixed number of records and perform operations on this limited set of data. Take a look at the following hep documentation which explains more about this.
You could still set a value for the VirtualItemCount. If you set a value that is greater than the actual number of items, RadGrid will show all available items plus empty pages (or whatever other content you set) for the items that exceed the actual number.
For example you have a data source with 9'000 items and you set VirtualItemCount to 10'000. If your page size is 1000, the grid will render 10 pages and the last page will be empty (or with NoRecordsTemplate if you're using such).
All the best,
the Telerik team
Is there a way to get current DataSource? so i am setting whole list (its not data table or set its a DTO) as data source to grid. If when next page or any paging command is clicked and it needs data source i just want to take current one and give it back to the grid.