I have a UltraTree with Nodes, where i want a UltraComboEditor beside. My Node now has a Checkbox, a Image and a Text.
Beside the Text should be a ComboEditor.
You can see how the tree should look like in the next picture.
UltraTreeNode node = new UltraTreeNode(); node.Override.NodeStyle = NodeStyle.CheckBox; node.LeftImages.Add(element.Image); node.Text = element.Text;
node.Override.EditorComponent = new MyCustomControl();
Hi,
There are a few different ways you might go about achieving this. But you can't really do it with a single ViewStyle.Standard node.
One hurdle is that a ViewStyle.Standard node doesn't have any way to store a third piece of information. The UltraTreeNode has a CheckState property to store the state of the built-in checkbox and it has a Text property to store the text. But there's no third property to store the value of a ComboEditor. Attaching an UltraComboEditor to the node edits the node's Text.
So the simplest way I can see to get around this would be to make your child nodes show in ViewStyle.Grid. That way you could have a column for the checkbox, one for the image, one for the text and one for the combo. How you do that depends on the structure of your tree, but from the screenshots here, it looks like you have a pretty simple structure with only two levels. So if that's the case and your second level is always going to be child nodes, you could create a ColumnSet and apply it to the tree's NodeLevelOverrides for the second level.
I attached a small sample project here to demonstrate the basics.
WindowsFormsApplication19.zip
Hi Mike,
thanks for the answer. I doing well with your sample but still have some problems and questions.
- how can i hide the border around the grid/columns? I only want checkbox, image, text, combo, with no border around. I tried the following two lines, but with no success.
tree.BorderStyle = UIElementBorderStyle.None;
tree.ShowRootLines = false;
- How can i hide some columns in special rows?
As you can see in the picture, i only want to see the green comboColumn, but hide all red parts of the picture.
- I have problems to display my image in the imageColumn. i use a ImageList and what to set the image with its ImageList Name in the Column.
- The click on the Checkbox is not responding. which event/setting do i need?