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

radgrid won't persist through postback, please help

1 Answer 65 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Viktor
Top achievements
Rank 1
Viktor asked on 06 Oct 2010, 03:44 AM
I'm baffled and confused. I have several radgrids on my site where I use a linqdatasource declared in aspx and modify the result of it through different grid events. Everything works well there. But now I have to bind the grid from the code-behind, but when a user clicks a button... So I understand that just using radgrid.bind will not work well for sorting/filtering/editing, when I try that the grid loses all the values and I have a blank grid until another postback is caused. 

So I read that I must use the onneeddatasource event, but i need the grid to be rebound on button click event, how do i make it work? I suppose i could add some flags when button is clicked and when needdatasource occurs then bind depending on the flag?

Please help.

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 06 Oct 2010, 04:36 PM
Hi Viktor,

Attached to this message is sample project illustrating how you can achieve the desired functionality. Check it out and let me know if any issues arise.

Best wishes,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Ajax
Asked by
Viktor
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or