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
No Data
Reply
  • 469350
    Offline posted

    Hi,

    This probably had nothing to do with the issue, but just out of curiosity, why are you assigning the CheckEditor to the cell and not the column?

    Anyway, I tried this out and I get the same results. I then tried the same thing using a CheckEditor in an UltraWinGrid cell and it worked fine. So it looks like this is a bug in the tree. I'm going to ask Infragistics Developer Support to create a case for you and write this up as a bug for developer review.

    Regarding the focus rectangle - the DrawFilter doesn't work because you are applying a DrawFilter to the UltraCheckEditor control and that control isn't even displayed. If you want to remove the focus rectangle from the tree, you need to use a DrawFilter on the tree control.

Children