Been using Infragistics for over 1 year now. We built a framework around the Winforms controls. We have Comboboxes that need to detect if the value entered exists in the list the box is bound to and prompt if the value is a new value.
Everything has been working great, up until a "fix" was made to the combobox so that if the value entered is not found in the column defined as the display column, the value column is searched. If the value entered is found in the value column, the combobox now points to that row of the list.
It has been suggested to use the ItemNotInList event to trap for this situation. GREAT! However, putting code in this event works fine, except that you can not put any kind of prompt in this method. Once the prompt is hit, the displayed value changes to the row that contains that value in the id column. We need to figure out how to trap for values not found, without changing the displayed value.
Thanks for any help.
mduff said:I think that my igv2011.2 is installed correctly, but VS IntelliSense doesn't offer UltraComboEditor.EventManager for me and the compiler doesn't permit my reference to it.. So, I'm soldiering on w/out a skip of the ValueChanged event.
I the compiler is telling you that the EventManager does not exist, then something is seriously wrong and I would strongly advise you to see if you can get that resolved, because it's certain to cause you other serious problems down the road.
What error message do you get when you try to refer to the EventManager in code?
I think that my igv2011.2 is installed correctly, but VS IntelliSense doesn't offer UltraComboEditor.EventManager for me and the compiler doesn't permit my reference to it.. So, I'm soldiering on w/out a skip of the ValueChanged event.
As for the rest of my post, it was my bad. I had misspelled the name of the DisplayMember. Trapping the ItemNotInList event and adding the user's input as a DataSource row DOES work for permitting freestyle data entry w/in the UltraComboEditor.
Hi,
What do you mean by "UltraComboEditor.EventManager is gone"? The EventManager hasn't gone anywhere. It's still there. We would never remove a property like that as it would break backward compatibility.
I downloaded my original sample and updated it to 11.2 and tested it and it works just fine. Same as it always did.
Here's some more bad news - by ig v2011.2, your "fix" is broken. If we have a list as described earlier with values of 1, 2, 3 and display texts, respectively, of A, B, C and assign that (DataTable) as a UltraComboEditor DataSource, everything works fine as long as the user sticks to the list. But we all need this control to also accept un-listed values, like when the user is creating a completely new record.
Your attached example no longer works because UltraComboEditor.EventManager is gone. I came up with the same strategy as you in that, when I detect unlisted text, I add that text as a row to the DataSource DataTable and a value of 0. But then as soon as focus is lost, the control reverts to displaying a mere zero and, worse yet, the row that I added in ItemNotInList() before Validating() doesn't show when the list is dropped down.
There's got to be a better and easier way.
There's no built-in way to do this, but you could code it yourself using the KeyDown or maybe KeyPress event.