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
335
Grid shows old data after batch update - unless I reload it once again
posted

Hello, I have a little problem in a pretty straight forward scenario:

A WebHierarchicalDataGrid is filled with data from a DataSet on every PageLoad event with the following settings

- DataViewState is disable

- ViewState enabled (inherit)

- AutoCrud disabled

- BatchUpdate enabled

- DataSourceId is not set

Like I said, in the end of PageLoad, my BindGrid method is called

Protected Sub BindGrid()     

   Dim ds As DataSet = New DataSet

      ds.Tables.Add(GetData(ddlEmployee.SelectedValue))

      WebHierarchicalDataGrid1.DataSource = ds

      WebHierarchicalDataGrid1.DataBind()

End Sub

Now, when update data in the grid, I manually update the database inside the RowUpdating event by calling a stored procedure.

The problem is - after all the rows have been updated and the page reloads, I still get the old values. Only if I refresh the page again, then I see the new values. So it seems to me, that when pressing the save button, the PageLoad is called, loading the still not updated, old values from the database to the grid, then the rows are updated in the database, but the grid shows the data that was load before the update.

What can I do. I cannot find a event that is called after all the rows have been updated so that I could rebind the grid to the updated datasource. Also, setting the DataViewState does not work, because it tells me that the datasource has no primary key. I would prefer a way without DataViewState though.

Thanks a lot, Kevin