Hello,
I just upgraded to Infragistics WinForms 11.2 (11.2.20112.1010) hoping that this problem would have been addressed.
I have untracombo boxes in forms (need the multi-columns support) but the event ItemNotInList does not fire. Instead, an error is raised if the user types and their text does not match an item in the list.
Two questions/requests: How do I get this to work and if it is not supposed to work directly, then will you consider removing the event from the control.
Thanks, Norm
Hello Norm,
Right now I made a test using mentioned version 11.2.20112.1010 and also with the latest version 11.2.20112.2004. In both cases the ultraCombo1_ItemNotInList() event fired after exit edit mode. The event fired before Validating event of the control whenever the text value in the editor portion is not a value from the list. If you are able please send us small sample that reproduce your issue. I`ll be glad to research this issue for you. If you have any questions, do not hesitate to write me.
Regards
Hi Gregory,
I am heading out right now so I do not have enough time to prepare an isolated sample. I do use a standard set of class methods to configure and populate all of my UltraComboboxes because they are re-used so many times throughout my application so there may be some conflicting setting in these general configuration methods.
Can you send me your sample so that I can compare my settings; maybe there is some other property of the UltraCombobox that I have set that is conflicting.
Thanks; Norm
HI,
Could you please take a look at the attached sample and video file. Please let me know if you have any questions. Feel free to modify my sample if you think that your scenario is different.
Hi,
Have you been able to resolve your issue ? Did you have a time to take a look at the attached sample. If you still have any concerns or questions I will be glad to help.
I have been able to verify the condition that causes the error. My combo box has a GUID column in the data table that is the ValueMember. The control is bound to a Guid column in the Data Set (Binding Source) for the form. The Data Source Update Mode is set to OnPropertyChanged.
This is different from your sample application in that you sample is not bound to a data source in a database.
When the non-trappable error occurs, the text indicates "Guid should contain 32 digits with 4 dashes ..."
Thanks - Norm
Question relating to my findings:
Is there a way to set a default value that the control uses when the user types a value that is not in the list. If there is, then I could set this property to an empty GUID to prevent the error from occurring and still use the property setting for Data Source Update Mode to "On Property Changed".
When the Data Source Update Mode is "OnValidation" then the system error for an invalid GUID value is not thrown and the ItemNotInList event is thrown.
The reason that I has set the Data Source Update Mode to "OnPropertyChanged" is that the users of my application are used to selecting a different value from a combo box and then closing an edit form without tabbing off the combo box. In this scenario, the control never Validates and the users new selection does not get saved.
nwdeitech said:Is there a way to set a default value that the control uses when the user types a value that is not in the list.
Maybe you could try :
private void ultraCombo1_ItemNotInList(object sender, Infragistics.Win.UltraWinEditors.ValidationErrorEventArgs e) { //MessageBox.Show("ultraCombo1_ItemNotInList() event fired"); ultraCombo1.Value = "My default Value"; }
private void ultraCombo1_ItemNotInList(object sender, Infragistics.Win.UltraWinEditors.ValidationErrorEventArgs e)
{
//MessageBox.Show("ultraCombo1_ItemNotInList() event fired");
ultraCombo1.Value = "My default Value";
}
nwdeitech said: The reason that I has set the Data Source Update Mode to "OnPropertyChanged" is that the users of my application are used to selecting a different value from a combo box and then closing an edit form without tabbing off the combo box. In this scenario, the control never Validates and the users new selection does not get saved.
I`m not sure that I understand your scenario, but when the user try to close the win form, the order should be:
1. Our UltraCombo control will exit from Edit Mode - the ItemNotInTheList event will fired
2. Then the WinForm will be close.
Please let me know if you think that I misunderstood your scenario or if you have any questions.
One more note. In order to replicate my scenario, you would need to work with 2 tables. One is bound to your Binding Source/Navigator and has a Guid column that relates to a Guid column in the second table. The second table would be the source of the Combo Box. The combo box would be bound to the GUID column in table 1 and the Value member of the combo box would be the Guid column from Table 2.
So, if your database includes a table for something like tasks assigned to a staff member (based on the TaskID GUID column) that would be the source for the binding navigator. Then the Task table would be the source for the combo box where its Value Member is the TaskID Guid column.
Thanks,
Norm
Hi Georg,
Thank you for the video. I followed most of what you were doing but think that I missed a few parts because it was moving too fast and I would have liked to interact while it was playing.
Correct me if I am wrong. It looked like the combo box was bound to the text value displayed and not the GUID column. With it bound to the Text, you set the Advanced property for Data Source Update Mode to "OnPropertyChanged". This would not cause the error that I encountered because there is no formatting issue for the bound string. Then, when you typed in the "Task A 333333" value, your data source that was bound to the control text columns got updated.
I have started changing my application to use the setting "OnValidation" and with come coding style changes I think that I can made a user interface that will be acceptable to my clients.
Rather than taking more of you time on this, you can close the current thread and if I run into a roadblock down the line I will raise questions then under a new thread.
Thanks for provided information and sample. I have not AdventureWorks databse, but I think that I was able to reproduce your issue using my Test database. Could you please take a look at the attached video file. There you will see (between 4:10 and 5:10 minute) that ItemNotInList event doesn`t fired. This is expected behavior, because like in your scenario we set : The DataBindings property “Data Source Update Mode” (in the Advanced dialog of the Data Bindings property) is set to “OnPropertyChanged”.
By this way during type "Task A 33333" in the UltraCombo we immediatly modify this item - look at the video to see that this item is already change it. So when we leave the control, the ItemNotInList event will NOT fired, because our item "Task A 333333" already exist. I think that it is expected behavior.
If you repeat the same, but with the TaskID column (GUID column , Not null), so you will get the same behavior, but the application will throw exception (on a database level or earlier ).
I`m not sure what is your final goal, but I think that this behavior is expected. If you provide us more details about your scenario and what you are looking for, maybe we could suggest something
Please if you have any questions, do not hesitate to write us
The attached zip file contains a sample project to demonstrate the problem. There is a Word document with notes about the progect. At the top of the code behind the form, change the value of the variable "svrName" to identify where your AdventureWorks database resides.
Hi Georgi,
The problem is that when the control is bound, and the property setting under DataBindings | Advanced for "Data Source Update Mode" is set to OnPropertyChange, the Not In List event does not file. Instead, it appears that the Binding Source tries to assign an invalid GUID value to the strongly types dataSet which causes the error to be raised. (I have not found a way to catch this).
Since I have been able to determine the various property settings that cause this error condition, I will prepare a small test project that uses the AdventureWorks database and send it to you.