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

Persistence of the dynamic datasource

1 Answer 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marco Miccini
Top achievements
Rank 1
Marco Miccini asked on 08 Sep 2009, 09:40 AM
Hello, here is my problem.
I define an initial SqlDataSource sqlDataSource 1 statically and, according to some input parameters, at runtime I update it dinamically when clicking a button (say btnUpdate), binding it to the RadGrid1 control.
The grid shows the correct results but,  when sliding to a second page of results, the items found are not the ones filtered by the updated query but by the initial of the sqlDataSouce1 statically defined.
All this is done with Ajax without postbacking the page.
Where is my error?
Thanks.
  

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 09 Sep 2009, 05:26 PM
Hello Marco,

When navigating to another page the RadGrid actually rebinds itself. Since the button updating the select command hasn't been clicked in this case the select command reverts to its default value set in the markup. To avoid this you should save your select command in the viewstate. I am attaching a sample project demonstrating one possible approach to such functionality.

I hope this helps.

Regards,
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Marco Miccini
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or