Hi,
I just updated to latest version and wanted to use the new unbound check box column. It works fine but I have a question:
Is there a way to disable the check box in initial row event for some rows?
IS there a way to disable the headercheckbox(unboundcheckbox) based on a condition ?
Like say if the number of rows is greater than 1000 disable the header checkbox
Hi Thomas,
I am following up to see wheter your issues have been resolved. Please contact me if you have any questions.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://ko.infragistics.com/support
The UnboundCheckBoxColumn for the WebDataGrid is not implemented using a checkBox control for each row so there is no object to be accessed and disabled.
I have created a sample for you using the Northwind DB which demonstrates how your requirement could be achieved. The sample employs client side functions in order to "disable" changing the state of even indexed rows.
protected void WebDataGrid1_InitializeRow(object sender, Infragistics.Web.UI.GridControls.RowEventArgs e) { if (e.Row.Index % 2 == 0) { e.Row.Tag = true; e.Row.Items[3].CssClass = "disabled"; } }
And the client-side code:
<script type="text/javascript" id="igClientScript"><!--function WebDataGrid1_Grid_HeaderCheckBoxClicked(sender, eventArgs){ for (i = 0; i < $find('WebDataGrid1').get_rows().get_length(); i++) { if ($find('WebDataGrid1').get_rows().get_row(i).get_tag() == true) { $find('WebDataGrid1').get_rows().get_row(i).get_cell(3)._setCheckState(false); } } }function WebDataGrid1_Editing_CellValueChanging(sender, eventArgs){ if (eventArgs.get_cell().get_row().get_tag() == true) { eventArgs.set_cancel(true); } }// --></script>
Please tell me if this helps.
Best Regards,Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://ko.infragistics.com/support