Hi,
I am trying to create a dropdown combo that can also create an new item or rename the selected item (i.e. change the text). It should function like a dropdown so when the user selects an item a selection change event is raise. if the user enters some text then the combo should either rename the current selection or create a new one using the text as the name. My attemp to do this has issues one of wich is the combo goes it to edit mode, the drop down no longer appears and refuses to come out of edit mode. I have attaced my code. is there an example of how to do this? if not can someone point me to whats going wrong.
Thanks in advance
Hi j2aircraft,
I have constructed and attached a sample which demonstrates an approach for the behavior that you have described; wherein the user may both add new items as well as edit existing items within the Items collection of the UltraComboEditor.
This approach involves hooking into both the SelectionChanged event of the UltraCombo as well as the KeyDown event of the Editor, exposed from the UltraComboEditor. Within the SelectionChanged event, I am checking whether an item has been selected and creating a reference to this item.
Within the KeyDown event handler of the Editor instance, I am checking for one of either two conditions; that is, if an item has previously been selected which will result in that item being edited, if the supplied text deviates from its current value; or if an item has not yet been selected, in which case a new item will be created with the text entered by the user.
Please find the commented sample attached.
If you have any further questions regarding this approach, please let me know.
Sincerely,Chris KDeveloper Support EngineerInfragistics, Inc.www.infragistics.com/support