Infragistics4.Web.v11.1, Version=11.1.20111.1006
Microsoft .NET Framework Verion 4.0.30319 SP1Rel
I need to disable a column in the WebDataGrid based on a value in a DDL. If the user selects CarbonCopy in the DDL, I check the BoundCheckBoxField for all the rows in the grid. Then I need to disable the column because the user cannot uncheck these fields. I have not been able to figure out how to get at the ReadOnly property for the column. FYI - I cannot use the CellValueChanging event to cancel the eventArgs because I am setting the value in the same function. Here is my code...can you help?
if
((ddlSigningMethod.options(ddlSigningMethod.selectedIndex).value == 'CarbonCopy') ) {
var wdgDocuments = $find('<%= wdgDocuments.ClientID %>');
// Spin though the Document Grid, checking all the Selected checkboxes
for (var i = 0; i < wdgDocuments.get_rows().get_length(); i++) {
selectedDocument = wdgDocuments.get_rows().get_row(i).get_cellByColumnKey(
"HasSignerAssociatedWithDocument");
selectedDocument.set_value(
true);
}
// These do not work to help me disable the row
wdgDocuments.get_behaviors().get_editingCore().get_behaviors().get_cellEditing().get_columnSettingFromKey(
"HasSignerAssociatedWithDocument")
wdgDocuments.get_behaviors().get_editingCore().get_behaviors().get_cellEditing().get_columnSettings()
Hi IntegraSys76,
Technically it is not possible to set the read only property of a column setting for cell editing. It would require going back to the server to accomplish this. However, with checkbox columns, we scan for the column setting in the initialization and set _editableCheckbox on the column. When it is set to false, clicking on the checkboxes will not switch the value. This is what I would suggest doing in your case.
regards,David Young
Thanks for the quick reply. I do not know what you mean by ...
we scan for the column setting in the initialization and set _editableCheckbox on the column
I know that I cannot disable an individual cell but there is no way to disable the entire column in JS? I am also trying to do this on the server side without luck. This example is an UnboundCheckBoxField.
Dim
gridColumnEditSetting As ColumnEditSetting
gridColumnEditSetting = whdgOrganize.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings(
gridColumnEditSetting.ReadOnly =
True