Infragistics4.Web.v11.1, Version=11.1.20111.1006
I am working with a WHDG. How do I disable a column on the server? Here is my code behind for a column in the parent row (RemoveDocument) and the child row (SignatureTypeEnumValue).
whdgOrganize.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings(
"RemoveDocument").ReadOnly = True
whdgOrganize.Bands0).Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings(
"SignatureTypeEnumValue").ReadOnly = True
<ig:WebHierarchicalDataGrid ID="whdgOrganize" runat="server" AutoGenerateColumns="False" AutoGenerateBands="False" DataKeyFields="LoanAppEnvelopeDocumentRecID" EnableAjax="false" EnableDataViewState="true" Height="400px" InitialDataBindDepth="1" Style="Z-INDEX: 100; LEFT: 20px; POSITION: absolute; TOP: 43px" Width="1070px">
<Columns> <ig:UnboundCheckBoxField Key="RemoveDocument" Header-Text="Rem" Width="30px"></ig:UnboundCheckBoxField> <ig:BoundDataField DataFieldName="DocumentDescription" Key="DocumentDescription" Header-Text="Document Description" Width="403px" ></ig:BoundDataField> <ig:BoundDataField DataFieldName="LoanAppEnvelopeDocumentRecID" Key="LoanAppEnvelopeDocumentRecID" Hidden ="true"></ig:BoundDataField> </Columns>
<Behaviors> <ig:EditingCore> <Behaviors> <ig:CellEditing> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="RemoveDocument" ReadOnly="false"/> <ig:EditingColumnSetting ColumnKey="DocumentDescription" ReadOnly="true" /> </ColumnSettings> </ig:CellEditing> </Behaviors> </ig:EditingCore> <ig:Selection Enabled ="true"></ig:Selection> <ig:Activation Enabled="true"></ig:Activation> </Behaviors>
<Bands> <ig:Band Key="LoanAppEnvelopeDocumentSignerSignatureRecID" DataMember="Signature" DataKeyFields="LoanAppEnvelopeDocumentSignerSignatureRecID" AutoGenerateColumns="false"> <Columns > <ig:BoundDataField DataFieldName="SignatureTypeEnumValue" Key="SignatureTypeEnumValue" Header-Text="Signature Type" Width="130px"></ig:BoundDataField> <ig:BoundDataField DataFieldName="SignerRole" Key="SignerRole" Header-Text="Role" Width="25px" ></ig:BoundDataField> <ig:BoundDataField DataFieldName="SignerName" Key="SignerName" Header-Text="Name" Width="260px" ></ig:BoundDataField> <ig:BoundDataField DataFieldName="SignatureFieldName" Key="SignatureFieldName" Header-Text="Reference" Width="445px" ></ig:BoundDataField> <ig:BoundDataField DataFieldName="LoanAppEnvelopeDocumentRecID" Key="LoanAppEnvelopeDocumentRecID" Hidden ="true"></ig:BoundDataField> <ig:BoundDataField DataFieldName="LoanAppEnvelopeSignerRecID" Key="LoanAppEnvelopeSignerRecID" Hidden ="true" ></ig:BoundDataField> <ig:BoundDataField DataFieldName="LoanAppEnvelopeDocumentSignerSignatureRecID" Key="LoanAppEnvelopeDocumentSignerSignatureRecID" Hidden ="true" ></ig:BoundDataField> </Columns> <Behaviors> <ig:EditingCore> <Behaviors> <ig:CellEditing> <EditModeActions EnableOnActive="true" EnableOnKeyPress ="true" MouseClick="Single"/> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="SignatureTypeEnumValue" EditorID="ddpSignatureType" ReadOnly ="false"/> <ig:EditingColumnSetting ColumnKey="SignerRole" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="SignerName" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="SignatureFieldName" ReadOnly="true" /> </ColumnSettings> </ig:CellEditing> </Behaviors> </ig:EditingCore> </Behaviors> </ig:Band> </Bands>
<EditorProviders> <ig:DropDownProvider ID="ddpSignatureType"> <EditorControl ID="ecSignatureType" runat="server" StyleSetName="Office2007Blue" EnableRenderingAnchors="false" DisplayMode="DropDownList" DataKeyFields="Value" TextField="Description" ValueField="Value"/> </ig:DropDownProvider> </EditorProviders>
</ig:WebHierarchicalDataGrid> </Template> </ig:ContentTabItem>
Hi IntegraSys76,
if you mean to disable editing as you are do this in the markup then try this:
this.WebHierarchicalDataGrid1.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings["SignerName"].ReadOnly = true;
this.WebHierarchicalDataGrid1.Bands[0].Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings["SignerName"].ReadOnly = true;
We have just upgraded our Infragistic version to the following yesterday but it does not matter because this still does not work. Infragistics4.Web.v11.1, Version=11.1.20111.2135
I am trying to disable editing on a WDHG column on the server code side based on another fields value. I have the following coded in my code behind, which does not work. The checkbox and dropdown are still editable.
whdgOrganize.Bands(0).Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings(
I have figured out that all I needed to do what set the EditorProvider to disable the column in the code behind when the situation will not allow the user to change the values: ddpSignatureType.EditorControl.Enabled = False
But I have not figured out how to do this on an UnboundCheckBoxField. I am currently cancelling the event in JavaScript but it would be nice to know how to make this work in the code behind.
Hurray! That worked! Thanks for your help!
whdgOrganize.GridView.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings("RemoveDocument").ReadOnly = true
Parent - whdgOrganize.GridView
First Child - whdgOrganize.GridView.Rows(0).RowIslands(0)
Cancelling the event in JavaScript is also an option. However try to disable with this:
this.WebHierarchicalDataGrid1.GridView.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings["RemoveDocument"].ReadOnly = true;
but first add RemoveDocument to the ColumnSettings collection