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;
You could do that, too. But personally, I think it's a lost easier to just assign a blank image.