I have a reset button.
Clicking that button should clear my grid. I want to do this on client side. Any suggestions.
Thanks
anyone?
The easiest way to do this is to loop through your grid's Rows collection and use its remove() function to remove each row so long as any rows remain. I'm fairly sure that this will only work if the AJAX functionality of the grid is turned off.
The following example assumes that "oGrid" is a reference to your grid. I'm not currently able to test this code, so it might require some adjustment, but should illustrate the approach:
var rows = oGrid.Rows;// Loop through the array backwardsfor (var i = rows.length - 1; i >= 0; i--){ // Remove the row without raising events - this second parameter is optional rows.remove(i, false);}
If you allow multiple row selection, you can instead mark all the rows as selected, then call the grid's deleteSelectedRows() function. This is much better in performance, if I recall correctly, but depends on your grid being already configured to allow multiple row selection.