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
55
UltraCheckEditor.IndeterminateAppearance.Image = null showing the Unchecked Image?
posted

Hi,

i just created a check editor for a column, with the CheckAppearance.Image and Apperance.Image set to 2 different images and i sent  IndeterminateAppearance.Image = null. also i've already set checkEditor.ThreeState = true.

 however when the bool? has no value, it still shows the Appearance.Image, why is that?

Parents
  • 80
    posted

    I encountered this same issue after upgrading to v8.2 and found that the following code will prevent the checkbox from being drawn when the state is indeterminate by using the DrawFilter property on the grid:

    grid.DrawFilter = new GridCellDrawFilter(); // the class defined below, for me this is in the contructor of my derived grid class after the InitializeComponent() call

     

    public class GridCellDrawFilter : Infragistics.Win.IUIElementDrawFilter

    {

    public Infragistics.Win.DrawPhase GetPhasesToFilter(ref Infragistics.Win.UIElementDrawParams drawParams)

    {

    if (drawParams.Element is CheckEditorCheckBoxUIElement)

    {

    return Infragistics.Win.DrawPhase.BeforeDrawElement;

    }

    else

    {

    return Infragistics.Win.DrawPhase.None;

    }

    }

    public bool DrawElement(Infragistics.Win.DrawPhase drawPhase, ref Infragistics.Win.UIElementDrawParams drawParams)

    {

    CheckEditorCheckBoxUIElement chkEditorElement = drawParams.Element as CheckEditorCheckBoxUIElement;

    if (chkEditorElement == null) return false;

    if (chkEditorElement.CheckState == CheckState.Indeterminate) return true; // returning true indicates that this phase has been handled and the default processing should be skipped

    return false;

    }

    }

Reply Children