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,
I want to hide a column of web data grid. I am making hidden property of the column to true but I am getting a following error.
The control collection cannot be modified because the controls contain code block(i.e <%...%>)
i have tried making its width to 0 stil is visible..
How can I make it hidden?
Thanks
Swetha
The JavaScript works great, which was my original post. Thank you. I am still having trouble disabling the column on the server side but I have not gotten back to trying it again.
Hello Autumn,Please let me know if the solution with the javascript you have found resolves your issue.
Dave,
That worked for me on the client-side. Here is my code, in case it can help someone else:
wdgDocuments.get_columns().get_columnFromKey(
"HasSignerAssociatedWithDocument")._editableCheckbox = false;
For the server side problem, I do have a matching key, "RemoveDocument". Here is a piece of my grid HTML.
_editableCheckbox is an internal property we set on a column when scanning for column settings when the grid is created. As I said, you cannot change read only values on the client. But if you changed this property to false on the column of interest, I believe it should become read only.
As to your server code, setting a column setting on the server should work. Do you have matching key values?
-Dave