Hi,
I'm using UWG 2008.2 (CLR 3.5) with the latest patch (.2.20082.2149).
The grid is set to LoadOnDemand="Xml" and the InitializeDataSource event is implemented.
Everything works fine and the grid loads additional date when scrolled down. The grid is inside an AJAX updatepanel. When the user selects a row and presses on a seperate edit button, I get the selected row from the grid and open a dialog in the buttons click event. This works just fine if the grid hasn't been scrolled down (hasn't been loading on demand). If the grid did load additional data the SelectedRows collection is always empty, eventhough a row was selected by the user.
I found out that the InitializeDataSource event is fired before the button click event. But the SelectedRows collection is already empty when InitializeDataSource is fired.
This is a huge problem for me and I urgently need a solution.
Thank you for your help.
sbitsolution said:The grid is set to LoadOnDemand="Xml" and the InitializeDataSource event is implemented.
sbitsolution said:The grid is inside an AJAX updatepanel.
WebGrid's AJAX functionality (LoadOnDemand="XML") uses a different AJAX implementation than used by the ASP.NET AJAX Extensions framework (used by UpdatePanel). The two AJAX implementations cannot work at the same time.
I recommend that you either replace UpdatePanel with WebAsyncRefreshPanel (which uses the same AJAX framework as WebGrid), replace WebGrid with WebDataGrid (which uses ASP.NET AJAX Extensions), or disable the AJAX functionality of WebGrid (and can continue using UpdatePanel).
sbitsolution said:I found out that the InitializeDataSource event is fired before the button click event. But the SelectedRows collection is already empty when InitializeDataSource is fired.
One option is to disable the grid's AJAX functionality. In this way, you can persist the grid's selected rows across postbacks. You still have the UpdatePanel for AJAX functionality. Depending on the reason you're using the grid's AJAX functionality, disabling it is likely the best option.
Another option is to persist information about what was selected in some other fashion, so that you can access it on the server. This is not a trivial undertaking, and exact details will depend greatly on your application's details.
Thank you for your quick reply!
I have one question. I've never used the new WebDataGrid. Is it compatible with WebGrid? Can I just change the "assembly" and the name or does it have different properties and settings?
Meaning: Is there a simple and fast way to migrate an existing WebGrid application to WebDataGrid?
Thanx for your help!