i want to reset a data grid in javascript
can u plz help me out
Hi ppooja7,
In the client side, data grid renders as a HTML <Table>. So you cannot remove the DataSource of a DataGrid in the client side.(Because there is no DataGrid there.) The Table that is rendered in the client side still has the same id as the DataGrid. So you can access it using the getElementById() JavaScript function.
You can use the following JavaScript to clear a table.
- document.getElementById('dgJSTest').innerText = " ";
Here 'dgJSTest' is the name of the DataGrid.
By this script entire table will be cleared. If you want to keep the headers and the borders, you can set the appropriate HTML as the innerHtml property instead of innerText.
Hope this will help.