I need to hide certain cell buttons in a grid.
I can do it as long as the buttons are in the first band (I followed this example http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=5218)
The datasource I'm binding to has 2 bands and the buttons are in the child band. I've tried various client side event handlers to try and loop through the row in a similar manner to the example, but I can never get a reference to the child rows. Does anyone know how to do this?
Hello,
Yes, I think I know what is going on. Starting from getting the grid instance (similar to what is shown in the DevCenter KB article)
var grid = igtbl_getGridById( gridName );
You now have the client-side object of the grid and can loop through its rows, but this applies only for the master table. However, you can use the "getChildRows()" method of each row of the master grid to obtain if it has any child rows - if it does - you can execute the same logic for them as well:
More info on the CSOM getChildRows() method can be found here:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WebGrid_row_Object_CSOM.html
Please, let me know if this helps.
I did try this, but a count on the getChildRows object always returned zero (I know there are always at least 3 child rows to every parent row)
Here is the code I used
function UltraGrid1_InitializeLayoutHandler(gridName){ var grid = igtbl_getGridById( gridName ); var row; for( i = 0; i < grid.Rows.length; ++i ) { row = grid.Rows.getRow(i); for( j = 0; j < row.getChildRows.length; ++j ) { alert(j); var childRow = row.getChildRow(j) var btn = childRow.getCellFromKey("Button"); var hidden = btn.getValue(); if (hidden == "hidden") { btn.Element.style.visibility = "hidden"; } } }}