Hi,
Is it possible to execute a bulk update in the WebGrid using Ajax instead of 1 row at a time.
Basically I want the users to be able to modify multiple rows, add new rows, even delete rows then only execute the change when the user presses the Save button.
I have tried putting it into a WARP panel and that seems to work for the most part, but there are some problems with exception handling using an ObjectDataSource, when I set the e.ExceptionHandled value to true, the WebGrid throws some strange Debug error and when you press the debug botton on it, it does nothing.
I'm using 7.3 build 1043
Thanks in advance.
I think the XmlHttpRequest event is called for every think you do in the client.....
doesn't matter if you have he grid bound to an object data source or not,
when you use Xml you have to update the database as soon as the grid is modified.......
or store the changes somewhere....or even do nothing and after all the modifications you pick up what is in the grid and if there is rows that were not showned you just mantain....
But I don't know....you have to test to see....
I've already try to use Xml without much success.....
If you do succeed -> please share!!!
Yeah I'm trying to use Load on Demand - Xml, with just the standard Synchronous type.
I have tried using the XmlHttpRequest event also, but as soon as I enable this event every cell change and every row change gets executed on the server side in this event as soon as it changes in the grid.
One thing to note is that I have an objectdatasource bound to the gird with Update/Insert/Delete statements. I guess this is somehow causing them execute from the XmlHttpRequest.
I'm sorry....
I think I didn't read your message properly.....
Are you using Load on Demand - Xml???
If yes, what type defined in XmlLoadOnDemand? You have to define XmlHttpRequest event for it to work (in the aspx code, under onXmlHttpRequest)....and propably the row.DataChanged property will tell you if the row was added or modified
If not, infragistics have an updateRowBatch event that is called for every row modified or add and modified (by using row.datachanged property)
Thanks for your reply.
I have however tried this method without much success using the invokeXmlHttpRequest function in the following way:
for(var rowId in grid.ChangedRows){ var row=igtbl_getRowById(rowId); grid.invokeXmlHttpRequest(grid.eReqType.UpdateRow, row, null);
}
Since there was no server side rowUpdate event associated with the gird it didn't perform the update action.
When I added the rowUpdate event to the grid it then began executing as soon as i lost focus on the row.
What I noticed also was that the Newly added rows ended up in the grid.ChangedRows instead of in the grid.AddedRows where I expected them to be.
Maybe I have to use the grid.invokeXmlHttpRequest(grid.eReqType.Custom, ?, ?); somehow, but I'm not sure how to do this.
Any help would be appreciated.
Regards
You can simple bind the data in the grid without any event of the grid...
when the user clicks the save button, you go through the grid like grid.Rows and then send this new data source for the server
If that is not what your looking for try infragistics examples in http://samples.infragistics.com/2007.3/webfeaturebrowser/default.htm
grid -> row updating