Hi,
My following javascript code is able to delete only last row in the Grid. Can you please let me know what's the issue?
<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server" Height="350px" ><Behaviors><ig:EditingCore><Behaviors> <ig:RowDeleting /></Behaviors> </ig:EditingCore></Behaviors>
<input type="button" name="name" value="Delete All Rows(Client Side)" onclick="DeleteAllRows();" />
function DeleteAllRows() { var grid = $find("<%=WebHierarchicalDataGrid1.ClientID %>"); var parentGrid = grid.get_gridView(); var gridRows = parentGrid.get_rows(); var rowLength = gridRows.get_length(); var i = 0; for (i = rowLength - 1; i > 0; i--) { var row=gridRows.get_row(i); gridRows.remove(row); }}
Thanks
Vin
Hello vin,
Thank you for posting in our forum.
In this case you need to use the deleteRows() method of the row deleting behavior. It accepts an array of rows so you can delete multiple rows in one request. For example you can iterate through all the rows and add them to an array and the pass that to the delete rows method.
Let me know if you have any questions or concerns.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support
I've the same issue. Above code is not working properly. It is not deleting last row. Any idea?