I have grid that showing data from SQL. I want to be able to edit, add and delete rows on the grid without going to server.
I have error Async request failed and Original data source does not support deletes. I don't want to set deletes in my data source.
I will save data later when user leave the page. Can I have sample code?
Thanks
Hi,
Thank you for using our forum!
You can enable Batch Updating and then the rows will be updated/deleted only when you make a postback. Here are links for batch updating samples and functionality:
http://www.infragistics.com/samples/aspnet/data-grid/batch-updating
http://www.infragistics.com/community/blogs/dyoung/archive/2011/11/02/WebDataGridBatchUpdating.aspx
If you want to make updates/deletes manually you can set AutoCrud to false.
You can look at this videos and links for more information:
https://www.youtube.com/watch?v=-T-niq-oAOI
https://www.youtube.com/watch?v=VxGoBSTvG7c
http://thuru.net/2013/12/04/crud-operations-in-infragistics-webdatagrid/
Please let me know if I can provide any further assistance
I manage to delete rows client side, but have refresh grid issue. Let say I have 5 rows and delete 3 rows on client. When loop thru rows collection on client it still shows 5 rows.
var rowgrid = $find("UltraWebGrid1"); var rows = rowgrid.get_rows().get_length();
alert(rows);
I am deleting rows like this:
var grid = $find('<%= UltraWebGrid1.ClientID %>'); var gridRows = grid.get_rows(); var selectedRows = grid.get_behaviors().get_selection().get_selectedRows();
var rows = new Array();
var i1 = 0;
for (var i = selectedRows.get_length() - 1; i >= 0; i--) {
rows[i1] = selectedRows.getItem(i); i1++; }
grid.get_behaviors().get_editingCore().get_behaviors().get_rowDeleting().deleteRows(rows);
Rows are deleting from grid on screen, but still in rows collection when I loop later.