I am using Infragistics ASP.NET 2007 Volume 1.
I have a grid with XML load on demand that goes through the following sequence:
I also have an UpdateRow handler server-side. This handler uses the e.Row.Cells collection to update the underlying DataSource and then commit the changes to the database.
When these two processes are completed in two distinct AJAX callback contexts, everything works fine. The client grid values are updated via the first process in one AJAX callback, the user takes focus off the current row, and the UpdateRow handler is fired with a second AJAX callback and the e.Row.Cells collection has the updated values from the first process and commits them to the database accurately.
My problem occurs when both processes are done within the same AJAX callback context. In other words, the user updates the initial cell and then triggers the entire process by taking focus off the active row. In this scenario, the following occurs:
I've attempted to create a work-around by setting a Session variable to track if both the XmlHttpRequest handler and the UpdateRow handler are called within the same AJAX callback context. If so, I bypass the updating in Step #5 above using the e.Row.Cells collection and simply save my underlying DataSource direct to the database (since the values were already updated in Step #2). This allows the correct values to be saved, but the client grid still rebinds with the incorrect values, even though the underlying datasource clearly has the correct values when set to the .DataSource property of the grid during initialization.
The entire problem/solution boils down to this: I want to respond to the user updating a cell by retrieving some values from the database, update the grid with these values, and then call UpdateRow to commit the values. Seems straight-forward, but maddening to implement given the substandard documentation and examples for a complex set of controls. Can somebody please provide guidance?