I frequently use check boxes that have a backcolor and sometimes a border around that. The native checkbox allows a padding setting that can precisely locate the actual box just where you'd like it to be. The UltraCheckEditor has no such property, and setting it at runtime has no effect. How can I move it? And if someone has an answer, will it work in an UltraListView also?
Bob
This was very helpful. Thank you.
private class CheckEditorCheckBoxUIElementCreationFilter : IUIElementCreationFilter
{
private const int PADDING_LEFT = 5;
public bool BeforeCreateChildElements(UIElement parent) {return false;}
public void AfterCreateChildElements(UIElement parent)
if (parent is CheckEditorCheckBoxUIElement)
CheckEditorCheckBoxUIElement checkEditorUIElement = (CheckEditorCheckBoxUIElement)parent;
CheckIndicatorUIElement checkUIElement = null;
TextUIElement textUIElement = null;
// Get check and text elements:
foreach(UIElement element in checkEditorUIElement.ChildElements)
if(element is CheckIndicatorUIElement)
checkUIElement = (CheckIndicatorUIElement) element;
}
else if (element is TextUIElement)
textUIElement = (TextUIElement)element;
if (checkUIElement != null && textUIElement != null)
// Shorten text element in PADDING_LEFT pixels and move the same amount to the right:
textUIElement.Rect = new Rectangle(textUIElement.Rect.X + PADDING_LEFT, textUIElement.Rect.Y, textUIElement.Rect.Width - PADDING_LEFT, textUIElement.Rect.Height);
// Move check element to the right:
checkUIElement.Rect = new Rectangle(checkUIElement.Rect.X + PADDING_LEFT, checkUIElement.Rect.Y, checkUIElement.Rect.Width, checkUIElement.Rect.Height);
No, there is still no property for this. You should Submit a feature request to Infragistics .
Hi Bob,
There's no property for this. You might be able to acheive what you want using a CreationFilter, but it's not trivial.
You should submit a feature request to Infragistics. Request a Feature or Component