Hi
I am battling to get my webdatagrid to edit rows properly using the AJAX functionality shown on the Infragistics demo sites. All I am trying to do is when a row is edited the RowUpdating event on the server is fired in the background and the update is made. Here is my problem.
I am using a custom list of data objects coming in from a WCF service so I cannot use the SQLDatasource. I also dont want to use the ObjectDatasource as I need to be able to finely control the WCF service based on certain configurations.
First I simply fetch the data from the service and create a list of these objects. I then bind these objects to the grid in the page load event. If I do this however the RowUpdating Event simply does not fire. The reason I have discovered is that when the AJAX call is made the Datasource property on the Grid is Nothing. I have no idea why this is.
So after reading around I discover that the datasource property is reset on each postback. So I store my list of Business objects in a Session variable an on each page load I rebind the grid to this session variable. Now the RowUpdating Event does fire and I am able to get the GridResponse from the server. However now the changes made on the grid are rolled back to the original values. I simply cannot seem to simple get the data to change.
I am sure I am missing something obvious here, any help would be appreciated.
Many Regards
Andrew
Make sure you are just reassigning the datasource property of the webdatagrid on postback and not calling the Webdatagrid.DataBind() as u need not call the databind explicitly everytime.
On Postback I am only reassigning the datasource property to the session variable containing the dataItems. When the RowUpdating Event Fires I can see the OldValue and NewValues of the Row being updated but then the Grid simply reverts back to the Old Values no matter what I do in the RowUpdating Routine. I am even trying to get explicit reference to the underlying object in the datasource during the RowUpdating Routine and editing the data there but nothing happens to the grid the new data is simply lost.