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
1940
(Ultra)CheckEditor with image for true and false in a tree node cell
posted

Hello,

I got a tree with an unbound column like this:

UltraTreeNodeColumn ultraTreeNodeColumn = new UltraTreeNodeColumn();
ultraTreeNodeColumn.DataType = typeof(bool);
ultraTreeNodeColumn.AllowCellEdit = AllowCellEdit.Full;
ultraTreeNodeColumn.Key = notationEdit.ID.ToString();
ultraTreeNodeColumn.Tag = notationEdit;
ultraTreeNodeColumn.LayoutInfo.OriginX = 0;
ultraTreeNodeColumn.LayoutInfo.OriginY = -1;
ultraTreeNodeColumn.LayoutInfo.MinimumCellSize = new Size(20, 20);
ultraTreeNodeColumn.LayoutInfo.PreferredCellSize = new Size(20, 20);
ultraTreeNodeColumn.LayoutInfo.SpanX = 1;
ultraTreeNodeColumn.LayoutInfo.SpanY = 1;
ultraTreeNodeColumn.AutoSizeMode = ColumnAutoSizeMode.None;

while creating nodes I want to insert a (Ultra)CheckEditor in the a cell, like this:

UltraCheckEditor checkEditor = new UltraCheckEditor();
checkEditor.Visible = false;
checkEditor.UseFlatMode = DefaultableBoolean.True;
checkEditor.Size = new Size(16, 16);
checkEditor.Appearance.Image = Icons16.Placeholder;
checkEditor.Appearance.ImageHAlign = HAlign.Center;
checkEditor.Appearance.ImageVAlign = VAlign.Middle;
checkEditor.CheckedAppearance.Image = Icons16.OPDProcess;
checkEditor.CheckedAppearance.ImageHAlign = HAlign.Center;
checkEditor.CheckedAppearance.ImageVAlign = VAlign.Middle;
checkEditor.Style = EditCheckStyle.Button;
checkEditor.DrawFilter = new NoFocusRectDrawFilter();

this.ExtensionManager.ExtendedObject.Controls.Add(checkEditor);

e.Node.Cells[2].EditorComponent = checkEditor;

but I got 2 problems here:

First: the image for false is not displayed at all (the placeholder image has a very eye catching color), instead no image is displayed after clicking the cell with a value of true. So changing the cell value from true to false will draw  no image, the true image just disapears. Why?

Second: The check box always draws the focus rectangle, this is not desired. I was unable to get rid of it even with a draw filter that usually solved this issue.

what I already tried:

- using a CheckEditor, but this control doesnt even provide appearance for false?

- Creating the UltraCheckEditor with the designer

- deactivating all styles etc.

Any help is welcome!

Blue

Parents Reply Children
No Data