Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
910
Disabled state problem in grid cell when using custom Editing/Rendering Control
posted

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

Parents
No Data
Reply
  • 21795
    Verified Answer
    Offline posted

    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.

    CAS-168475-J3L0C6.zip
Children
No Data