I read this tutorial:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2011.2/CLR4.0/html/WebDataGrid_Enabling_Row_Deleting.html
I have a WebDataGrid entirely populated via javascript (volatile data, no need to write it to database, and I don't want postbacks to retrieve data each time). While adding rows to the grid works perfectly using
var grdPrices = $find('<%: grdprices="" clientid="">');
var arrData = myArray[i].split("|");
grdPrices.get_rows().add(arrData);
I can't remove rows from the same grid using the method you provided in the tutorial:
var nLines = grdPrices.get_rows().get_length(); for (i = 0; i < nLines; i++) { grdPrices.get_rows().remove(grdPrices.get_rows().get_row(0)); }
The only result I have is that the first row of the grid changes CSS, using igg_DeletedRow style, but no row is actually deleted.
How can I clear the grid via javascript?
I'm using Net Advantage 2012.1 with Net Framework 4.0.
hi all,
grid.get_behaviors().get_editingCore().undoBatchUpdate(row)
command working fine in newly add row using javascipt
but webgrid.DataBind(); rows delete/undo not working.
how to remove client side without postback.
help
Thanks for your assistance. Using undoBatchUpdate solved my problem.
Hi elvandar,
This means you have on batch updating. The grid would try to actually write/delete the rows from a database (assuming auto crud) on the next postback. If you want the row 'deleted', you can modify the igg_DeletedRow css to have display:none or something like that. It won't be visible, but the html will be there. An alternative, assuming all rows are batched added on the client, is to simply undo the add operation. Then the row is removed. grid.get_behaviors().get_editingCore().undoBatchUpdate(row);
regards,
David Young
Anyone out there for a hint??
I tried also this solution, as suggested in another thread, but the result is always the same, no row removed.
var oRows = grdPrices.get_rows();
grdPrices.get_behaviors().get_editingCore().get_behaviors().get_rowDeleting().deleteRows(oRows);
So, is there any way to remove rows via javascript without postback?