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
140
Webgrid Data Loading Problems using ObjectDataSource
posted

Hi,

I have a ObjectDataSource bound to the grid, the initial data load selects the data from the database 4 times using the same select statement, I have tried setting the datasource at runtime and design time with the same results in both cases.  I know its not the ObjectDataSource because when I bind it to the standard .NET GridView it only selects the data once.

Secondary problem to this is: I have the webgrid in a warp panel, when sending an asynchronous postback using the warp panel, the webgrid then refreshes the data in the grid 4 times using the same select statement before processing the update/insert/delete operation.  This seems excesive and totaly unwanted and unnecessary.  The side effect from this is that it retrieves my concurrency control column from the database when it should be using the value that is in the grid.

Any one else have these sorts of problems with the grid?

 Thanks

Parents
  • 1171
    posted

    It seems a bit unusual that the grid should be calling select on your data multiple times. It's hard to guess why this is happening without knowing more about your project. The best thing to do would be to take the problem to developer support. They'll be able to help you diagnose what's going wrong. 

    The grid will refresh the data on each postback. It does this so that it doesn't have to store the row information in ViewState.  It shouldn't be doing it four times though, only once. The ObjectDataSource has a caching option (I think the property is called AllowCache) that you might be able to use to avoid having to go back to the database on each postback. 

Reply Children
No Data