I am looking to hide (or disable) a button type column based on some external settings by row. On the initialize row event I would like to hide the button but the cell collection for the row only contains objects from my datasource (an object). I know I can say e.Row.Bands.Columns.FromKey() to get at the column but is there a way a collection where I can set the hidden property using either the row or column index? ....e.Row.Columns[colIndex].Cell .....??
I have found some examples but they seem to be from different versions of the Grid as those collections aren't available to me. I am using v6.3
Thanks in advance
You need to use JavaScript to selectively hide buttons generated for a button-type column in WebGrid. This has to be done client-side because the buttons aren't created until render time (after the PreRender event), which is too late for you to modify on the server.
The following article from our online Knowledge Base provides more information:HOWTO: Hide buttons in a WebGrid using client-side JavaScript
You could alternately use a templated column, where you can get fine server-side control on a cell-by-cell basis as to what content you put in. Typically, this requires much more code to get similar results, and will not be as performant as the non-templated approach.