Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
590
Rebind grid after an update occurs?
posted

My page consists of a WebDatagrid, 2 dropdowns, and a button. 

Dropdown 1 sets a parameter for the SelectCommand of the grids datasource.  

I then select rows in the grid, choose an item from "dropdown 2", and click the button to update the selected rows.

The button click event fires server side code which loops through the selected rows and calls a stored procedure to update them.  When the page completes the post back, the update rows are still in the grid, but they shouldn't be there anymore.  The grid will remove them if I choose a different item from "Dropdown 1" and go back.  And I know the update is working.

So how do I ensure the grid is displaying the most recent info after the updates occur?  I've tried calling the databind methods of both the datasource and webgird after the updates, but the rows still persist.

 

Parents
  • 2501
    Verified Answer
    posted

    Hello Mark,

    Thank you for submitting your inquiry to the Infragistics ASP.Net Forums. From your description, it seems since the update for the grid is performed in a button click, the grid does not know it needs to refresh its contents. 

    Try clearing the grid Rows, such as grid.Rows.Clear() and then call grid.DataBind() in the button click after the update occurs.  If that doesn't work, try calling grid.ClearDataSource(), resetting the DataSource and then grid.DataBind().

    Please let me know of your results.

    Sincerely,
    Mike D.
    Developer Support Engineer
    Infragistics
    www.infragistics.com/support

Reply Children