radgrid won't persist through postback, please help

2 posts, 0 answers
  1. Viktor
    Viktor avatar
    7 posts
    Member since:
    Aug 2010

    Posted 05 Oct 2010 Link to this post

    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.
  2. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 06 Oct 2010 Link to this post

    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
Back to Top