It seems that the UpdateRowBatch event is called once for each row in a WebGrid that is updated, instead of once for a "batch" of updated rows as its name suggests...
how does this different from the UpdateRow event besides losing cursor focus of an updated row does not trigger a postback?
If I want to handle ALL of the row updates at once, and walk through the grid rows using:
if WedGrid.DataChanged = WebGrid.Modified then
what are my options here?
Should I just handle this in the page_load even and check for Page.IsPostBack?
Thanks,Mike
mccamike said:It seems that the UpdateRowBatch event is called once for each row in a WebGrid that is updated, instead of once for a "batch" of updated rows as its name suggests...
mccamike said:how does this different from the UpdateRow event besides losing cursor focus of an updated row does not trigger a postback?
This means that you don't need to manually "walk" through the grid rows. You'll get one instance of UpdateRowBatch (or UpdateRow) for every row that was updated since the previous postback, and you'll get a reference to that row in the "e.Row" parameter. (This includes rows that were added and modified since the last postback, so checking whether the row is "Added" or "Modified" may still be useful.)
There's one additional event you may want to use when using the grid's batch events: UpdateGrid. This event is raised once after all AddRow, UpdateRow, UpdateCell, and/or DeleteRow events (or their "batch" equivalents) are finished. For instance, if you want to re-bind your grid to be certain that it reflects what's in your data source, you want to do this in UpdateGrid, since doing so in UpdateRowBatch could interfere with the update process.
Ah, very cool... UpdateGrid. Thanks much for the input... we're passing whole DataTables worth of data back to SQL Server here and I need to build a table based on all changed values in the grid, so having UpdateRowBatch called mulitple times is not really what I was looking for... I'll give UpdateGrid a shot.
In that case, the approach I suggest is to use UpdateRowBatch to build (one DataRow at a time) the list of data you want to update. Then, in UpdateGrid, you can pass those updates back to the database. It's more efficient than looping through the grid yourself.
I HONESTLY beg your pardon... I have been reading up quite a bit - but am still unsure... Please excuse.
Am I right in understanding that for multiple row updates on ultrawebgrid with paging enabled with code
UltraWebGrid.DisplayLayout.LoadOnDemand =
LoadOnDemand.Automatic;
you will have to use UpdateRowBatch and UpdateRowBatch will cause a postback?
Is there any way you can do multiple row updates without a postback for each modified row? Using version 8.3....
Is it possible to do the following: allow multiple row updates and when user either clicks on a Save Button or clicks on another Page number, loop through visible rows in the grid - figure out if there was a change and modify data in a session dataset?
Basically, what I am avoiding here is a postback on every row change... And updating my session dataset once per page rather than once per row change!
For somebody who is half way across the world, a postback is slow....and painful...
Thanks..