Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
320
Exception when using binding to UltraCombo with multiselection
posted

Hi

I'm attaching a sample project where you can see this behavior and here is the brief (at least I hope so) description:

I have model with two properties e.g. FirstList and SecondList both of type BindingList<DataObject> and two properties FirstSelected and SecondSelected both of type List<object>.

On my form I have two UltraCombos with multiselection which DataSource properties are bound to FirstList and SecondList and whose Value properties are bound to FirstSelected and SecondSelected.

In my model I have some code that clears SecondList and fills it with respective elements if FirstSelected is changed.

The problem is when I first check some values in first combo then check some values in second combo and then uncheck values in first combo I expect the second combo to be cleared.

But instead I get the exception {"Value cannot be null.\r\nParameter name: key"} with stack trace:

   at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
   at Infragistics.Win.UltraWinGrid.CheckedRowsCollection.VerifyCollection()
   at Infragistics.Win.UltraWinGrid.CheckedRowsCollection.Equals(List`1 values)
   at Infragistics.Win.UltraWinGrid.CheckedListSettings.OnRowsCollectionDataChanged(Object sender, DataChangedEventArgs e)
   at Infragistics.Win.UltraWinGrid.RowsCollection.FireDataChanged(DataChangedEventArgs args)
   at Infragistics.Win.UltraWinGrid.RowsCollection.OnListChanged(Object sender, ListChangedEventArgs e)
   at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e)
   at System.Windows.Forms.BindingSource.OnListChanged(ListChangedEventArgs e)
   at System.Windows.Forms.BindingSource.ResetBindings(Boolean metadataChanged)
   at System.Windows.Forms.BindingSource.SetList(IList list, Boolean metaDataChanged, Boolean applySortAndFilter)
   at System.Windows.Forms.BindingSource.ParentCurrencyManager_CurrentItemChanged(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.CurrencyManager.OnCurrentItemChanged(EventArgs e)
   at System.Windows.Forms.CurrencyManager.List_ListChanged(Object sender, ListChangedEventArgs e)
   at System.Windows.Forms.BindingSource.OnListChanged(ListChangedEventArgs e)
   at System.Windows.Forms.BindingSource.ListItem_PropertyChanged(Object sender, EventArgs e)
   at WindowsFormsApplication1.Model.OnSecondSelectedChanged() in C:\Users\chapand-a\documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Model.cs:line 94
   at WindowsFormsApplication1.Model.set_SecondSelected(List`1 value) in C:\Users\chapand-a\documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Model.cs:line 84

Could something be done about it?

Please look at the attached solution for all details. Libraries versions are 10.2

TestAppl.zip