D'Arcy from Winnipeg
Solution Architecture, Business & Entrepreneurship, Microsoft, and Adoption

Infragistics UltraWebGrid Clearing All Rows Client Side

Thursday, May 29, 2008 11:47 AM

I have an UltraWebGrid that I needed to clear all the rows out of. I found an article on the Infragistics Dev Center that suggested a looping construct that used the row.NextSibling!=null comparison. The problem was that it didn't work...the row.NextSibling would always return 'undefined'.

So I decided to take a different approach which actually works really well:

[Edit: Sorry, SubText doesn't like it when you try and copy/paste code directly into the web text editor apparanetly. Image version is below]

Voila...I've noticed that there's a bit of a delay that occurs while the rows in my grid delete (there's alot of them), but I'll worry about prettying that up later....at least for now I have them clearing out.

Hope this helps someone else.

D




Feedback

# re: Infragistics UltraWebGrid Clearing All Rows Client Side

D'Arcy:

Can you point me to the KB in question? I can have our Developer Support team review the article to see if there is a problem with the code.

Devin 5/30/2008 4:14 PM | Devin Rader

# re: Infragistics UltraWebGrid Clearing All Rows Client Side

That would be great Devin, thanks! I'll hunt it down tonight and email it to you.

D 5/30/2008 4:32 PM | D'Arcy from Winnipeg

# re: Infragistics UltraWebGrid Clearing All Rows Client Side

While i'm using this code igtbl_getRowById("MyUltraWebGrid1_r_"+cnt);
system shows an error msg like 'Name igtbl_getRowById' is not declared how to rectify this? 10/3/2008 5:27 AM | Sheeja

# delete rows in ultrawebgrid

//function to delete a row
function onClick(UltraWebGrid1,cellid)
{
if(confirm('Are you sure you want to delete all selected rows?'))
{
var grid = igtbl_getGridById(UltraWebGrid1,0);
var activerow = igtbl_getActiveRow(UltraWebGrid1)
grid.AllowDelete = 1;
//set the activerow
//Row variable would be the row number
var row = igtbl_getActiveRow(cellid).Element.id;
igtbl_setActiveRow(cellid,igtbl_getElementById(igtbl_getActiveRow(cellid).Element.id) );
//also select the activerow in the grid
igtbl_selectRow(UltraWebGrid1, row, true);
//select row delete!
// igtbl_deleteSelRows(oUltraWebGrid1,0);

igtbl_deleteSelRows(UltraWebGrid1);
}//if 4/7/2010 8:57 AM | lola

# re: Infragistics UltraWebGrid Clearing All Rows Client Side

It would be nice if you post actual code in text instead of image screenshot. 7/15/2010 2:00 PM | Yuriy

# re: Infragistics UltraWebGrid Clearing All Rows Client Side

The best way to clear all rows in ultrawebgrid is:

igtbl_getGridById("gridName").Rows.Element.innerText = "";

We are using Infragistics ASP.NET Controls for CLR 3.5 3/28/2011 1:39 AM | Sreedevi

Post a comment