Hi,
I have a grid where I use a custom control via UltraControlContainerEditor for the editing & render control of the grid like following:
UltraControlContainerEditor ultraControlContainerEditor_Double = new UltraControlContainerEditor(this.components); ultraControlContainerEditor_Double.EditingControl = new DoubleEditorInGrid(); ultraControlContainerEditor_Double.RenderingControl = new DoubleEditorInGrid();
gridPolynom.DisplayLayout.Bands[0].Columns[0].EditorComponent = ultraControlContainerEditor_Double;
This works fine, except that the disabled state is not recognized correct when we set the following:
gridPolynom.Rows[e.Row.Index].Cells[1].Activation = Activation.Disabled;
The result is, that the cell is not editable (good), but the disabled style is not set (font color is still black, not greyed out)
Am I doing something wrong? Any ideas to solve this?
Thanks,
Michael
Hello Michael,
Thank you for posting in our forum.
This is expected behavior. UltraControlContainerEditor will apply properties that apply to Control, such as BackColor or ForeColor, to the RenderingControl by default. However it cannot pass the ForeColorDisabled as Control does not expose such property. One possible workaround in your case is to set the appearance of the disabled cell. You may use code like this:
e.Row.Cells[1].Activation = Activation.Disabled;
e.Row.Cells[1].Appearance = this.disabledCellApp;
where disabledCellApp is predefined appearance. Please check the attached sample project where I have implemented this approach.
Thank you for using Infragistics Controls.