Hi, I would like to completely remove a row from a WebDataGrid so it no longer displays in the grid even though the post back has not occurred yet. Right now the row is just grayed and crossed out and there is a undo button placed over the row. I want it to disappear completely.
Here is my current JS:
function DeleteSelectedRows() { var WebDataGrid1 = $find("WebDataGrid1");
var rows = WebDataGrid1.get_rows();
for (i = 0; i < rows.get_length() ; i++) {
var row = rows.get_row(i);
var checked = row.get_cell(0).get_value();
if (checked) {
rows.remove(row);
}
Hello Bart,
Thank you for posting in our community.
Did you enable the BatchUpdating property of the EditingCore? If you did, then you should note that you can modify (edit, add, delete) multiple rows at once until post back occurs. Therefore when you attempt to delete rows on the client, the respective row to be deleted is only crossed with a line and at the left side of the row there is "Undo" button.
If you want to prevent this, you should set BatchUpdating property to false.
Another important thing is also that deleting of row on the client would be persisted if the data source that you're using supports auto CRUD operations. Otherwise you should handle the RowDeleting server side event and handle the deleted rows manually.
Attached is a sample with similar scenario for your reference.
Please let me know if you need any further assistance.
Sincerely,
Tsanna
Hi, yes, I enabled BatchUpdating on EditingCore so I would be able to modify multiple rows at once. That is exactly what I want. The problem is that deletions are implemented with a crossed out line. So, I can't set BatchUpdating to false because I would lose the multiple row edit before postback capability. I want to have BatchUpdating turned on and have rows be completely deleted in the UI.
If you need any further assistance regarding this matter please let me know.