Hi all
How can I add a Treeview to the dropdown of UltraCombo or UltraComboEditor ?I am also not sure what control I should use, UltraCombo or UltraComboEditor ?
I have tried:DropDownEditorButton local_DropDownEditorButton = new DropDownEditorButton();UltraTextEditor local_UltraTextEditor = new UltraTextEditor();local_DropDownEditorButton.Control = MyTree;local_UltraTextEditor.ButtonsRight.Add(local_DropDownEditorButton);this.ctlUltraComboEditor_Categories.DataSource = local_UltraTextEditor;
Thanks for any help !
Best regardsFrank Uray
Hi BrianThanks a lot, this works now fine.I did not realize to use the TextEditor as a ComboBox ...Thanks and best regardsFrank Uray
I think Vince's point was to use an UltraTextEditor instead of an UltraComboEditor/UltraCombo. This is because once you add the DropDownEditorButton, the UltraTextEditor will for all intents and purposes be like a ComboBox, the difference being that you can put any control you like in the dropdown area. So you want to have an UltraTextEditor right there on the form, instead of an UltraComboEditor.
Also note, while we're on the subject, that the DropDownEditorButton class exposes events, BeforeDropDown and AfterCloseUp, which are used to synchronize the contents of the edit portion of the UltraTextEditor and the content in the dropdown. For example, you might want to select a certain node based on the text in the edit portion so that the dropdown reflects the control's value, and you might also want to do something like show the text of the selected node in the edit portion after the user clicks a node.
Also note that the DropDownEditorButton exposes a CloseUp method, which you usually call in response to whatever action that is performed on the tree control that should close the dropdown. This is because the control you site on the dropdown doesn't know that it is on a dropdown, so you have to manually handle the closing of the dropdown.
Frank,
Yes: this is because WinComboEditor cannot accept a WinTextEditor as a data source.
I recommend not using WinComboEditor (or WinCombo) in this scenario. Use the WinTextEditor that youv'e created instead.
Hi VinceThanks for your quick answer.I have tried now like this:DropDownEditorButton local_DropDownEditorButton = new DropDownEditorButton();UltraTextEditor local_UltraTextEditor = new UltraTextEditor();local_DropDownEditorButton.Control = MyTree;local_UltraTextEditor.ButtonsRight.Add(local_DropDownEditorButton);this.Controls.Add(local_UltraTextEditor);this.ctlUltraComboEditor_Categories.DataSource = local_UltraTextEditor;It does not work (DropDown is empty) on both, the UltraCombo and UltraComboEditor.Do you know why ?Thanks and best regardsFrank Uray
For this setup, I'd suggest using the WinTextEditor control to act as your "dropdown" control. You alreayd have most of what you need - add the WinTextEditor to your form's Controls collection, and you should get the visual effect you're after.
The DataSource property of WinCombo and WinComboEditor expect something that implements IList, ITypedList, or IBindingList. Since WinTextEditor does not implement any of these, I expect that what you've written will throw an exception.