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

Change data in paging range

2 Answers 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bieters Bieters
Top achievements
Rank 1
Bieters Bieters asked on 03 Aug 2012, 01:36 PM
Hello,

I have a ridgrid for which i'm having paging.
Is it possible to modify data on this range of rows (the active paging range) on serverside?
For example the grid contains 270 rows, but only the first 10 are displayed with paging.
When the next range (10 to 20) is displayed, then I want to change the data for this range.

I already tried the PreRender serverside event, it gives the correct displayed rows with radGridProducts.Items.
I can loop them and change some values, but the datasource of the grid isn't refreshed. It displays the same old values.

Maybe another approach/event of the grid?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 06 Aug 2012, 02:29 PM
Hi Bieters ,

Could you please verify that you are using one of the suggested databinding approaches and not the simple way of DataBind()?
Declarative DataSource
Advanced Data Binding
Advanced Data Binding Demo

Or maybe you are looking for one of the following features?
RadGrid Custom Paging
Virtual Scrolling and Paging

You could also try to rebind your grid in order to refresh your grid's items:
RadGrid1.Rebind();

I hope this will help you to achieve your desired functionality.

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Bieters Bieters
Top achievements
Rank 1
answered on 07 Aug 2012, 05:27 AM
Thanks.

I found a solution already.
What I end up doing is keep track of the paging myself whith
radgrid.CurrentPageIndex: this is always accurate, also on postback (for example filtering, sorting, ...)

and radGridAanvragen_PageSizeChanged event to keep track of e.NewPageSize in the viewstate of the page.
It seemed that radGridAanvragen.PageSize isn't always correct on posbacks and the value is lost otherwise.
Tags
Grid
Asked by
Bieters Bieters
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Bieters Bieters
Top achievements
Rank 1
Share this question
or