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();
Thanks for following up with your progress! Glad we could help. :)
Hi Mike,
your solution works fine, thats exactly what we want.
thx for your reply.
We want our customers to drop the list down and choose an item, but it shouldn't be possible to type into it.
I'll try your solution and give you feedback.
Greets
Jochen Rosenthaler said:In my ComboBox i see the values of the ValueList properly. But unfortunately I'm able to write something in the combo by myself to an existing entry. I use comboColumn.AllowCellEdit = AllowCellEdit.Full; - if i use comboColumn.AllowCellEdit = AllowCellEdit.ReadOnly; - than i can not dropdown the comboBox and choose different values.
Just to clarify... what exactly do you want here? Are you saying you want the user to be able to drop down the list and see it, but not choose an item? Or are you saying they can choose an item from the list, but you don't want them to be able to type into the cell?I'm not sure if the former is possible, but I believe the latter is. The wasiest way is to create an UltraComboEditor control and set it to DropDownList and apply it to the column. It sounds like you are already doing that, anyway.
if (includeComboColumn) { var comboColumn = columnSet.Columns.Add("Combo"); comboColumn.DataType = typeof(int); UltraComboEditor ultraComboEditor = new UltraComboEditor(); ultraComboEditor.DropDownStyle = DropDownStyle.DropDownList; this.Controls.Add(ultraComboEditor); comboColumn.EditorComponent = ultraComboEditor; var valueList = new ValueList(); valueList.ValueListItems.Add(0, "Apple"); valueList.ValueListItems.Add(1, "Banana"); valueList.ValueListItems.Add(2, "Cherry"); valueList.ValueListItems.Add(3, "Grape"); valueList.ValueListItems.Add(4, "Watermelon"); comboColumn.ValueList = valueList; comboColumn.AllowCellEdit = AllowCellEdit.Full; }
Having a read-only combo while wanting to still be able to dropdown is not possible and considered to be a new product idea.
You should be able to modify the border using the combo's Appearance property.
Themes might be enabled. Theming is all-or-nothing. So if Themes are on, then whole control is drawn themed and you can't change any individual colors of any of the themed elements.
So you probably have to set UseOsThemes on the control to false in order to change the border
eg.
comboEditor.Appearance.BorderColor = Color.Red