Hi,
The easiest way to do this is through server side code:
You can put the Grid inside a CallbackPanel if you don't want to reload the whole page. There is no direct equivalent for Items.Clear on client side. If you must delete all items on client side, you can call this method in a loop:
http://www.essentialobjects.com/doc/1/jsdoc.public.grid.deleteitem.aspxIt will be something like this:
Code: JavaScript
//Get the client side Grid object
var grid = eo_GetObject("Grid1");
//Delete all items
for (var i = 0; i < grid.getItemCount(); i++)
grid.deleteItem(i);
Note that when you delete a row on the client side, it does not delete the item from the Items collection, when the page is posted back the Items collection will still contain all the items. However the "deleted" item has this property set to true:
http://www.essentialobjects.com/doc/1/eo.web.griditem.deleted.aspxThis allows your server side code to examine which item has been deleted and act accordingly.
Thanks!