Truncate grid from clientside

4 replies. Last post: March 12, 2010 4:19 AM by Handy Surya
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

Currently I'm using the WebGrid in a modalbox as lookup. The Grid doesn't have a datasource assigned, because it's filled from clientside. The user can't interact with the grid in any way; only to select a row.

Each search action will fill the grid from clientside. However, before each search action, I'd like to empty the grid. I tried this:

var grid = ISGetObject("SearchResultsWebGrid");
for(var i = 0; i < grid.RootTable.GetRowsCount(); i++)
{
    grid.RootTable.GetRow(i).Delete();
}
grid.RootTable.UpdateUI()

However, it's not giving me javascript warnings or other errors. And, it doesn't remove any rows... I searched this website for a solution, but couldn't find it so far.

Anyone got a solution or an idea how to truncate (delete all rows) from a webgrid at clientside?

Thanks!

All times are GMT -5. The time now is 3:36 AM.
Previous Next