I have a WebGrid with a button. In the ClientSideEvents, I set ClickCellButtonHander to a javascript function, "ButtonClicked".ButtonClicked has two params, gridName and cellid.Using cellid, I get the row whose button was clicked [var myRow = igtbl_getRowById(igtbl_getCellById(cellid).Row.Id);]myRow.length is always 8, the correct count; However, myRow.cells gives me anywhere from 2 to 8 cells, using the same gridwith the same data at the exact same row. Why is it never consistent? What is the problem?
thanks
I discovered a workaround, but my original question still stands...since myRow.cells is inconsistent, I can't call myRow.getCellFromKey("itemnumber").getValue(), since that cell sometimes doesn't exist, thus, is null and that line causes an error.
However, I can call parseInt(myRow.Element.cells[2].innerText) to get what I needed. It seems myRow.Element.cells has the complete cell set, whereas MyRow.cells is iffy.
I am not sure if row.cells is a public collection - going through the Client Side Object Model (CSOM) for row located here:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WebGrid_row_Object_CSOM.html
I do not see it listed there, so I guess you can probably use find / getCellFrom or another method property that could fit your case, but I am not sure row.cells is exposed as public (in javascript there is no way to hide internal / protected members).