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?
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 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; }
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; }
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;
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;
The control resolves up to the Appearance if no more specific appearance is specified. What you should do is use a blank image rather than null. Or, if you are using v8.2, you could use the new GlyphInfo property to control all of the possible states of the checkbox.