Hi Guys,
The following errors show up when I tried to add data to ultra combo editor:
Error Description: Unable to cast object of type 'Infragistics.Win.ValueListItemsCollection.get_Item(Int32 Index)
at Infragistics.Win.ValueListItemMetrics.IntializeValueListItemsSizeCache(Boolean rebuild)
at Infragistics.Win.ValueList.set_CheckBoxStyle(CheckStyle value)
at
Infragistics.Win.UltraWinEditors.UltraComboEditor.APplyCheckedListSettings(ValueList valuelist)
at Infragistics.Win.UltraWinEditors.UltraComboEditor.get_Items()
Here is my code:
objMultiSelect.Items.Clear();
// Add Items to the multi-select list
objMultiSelect.Items.Add(
"test1");
"test2");
"test3");
// Config objmultiselect list here
this.objMultiSelect.CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox;
this.objMultiSelect.CheckedListSettings.CheckBoxAlignment = ContentAlignment.MiddleLeft;
this.objMultiSelect.CheckedListSettings.EditorValueSource = EditorWithComboValueSource.CheckedItems;
this.objMultiSelect.CheckedListSettings.ItemCheckArea = ItemCheckArea.Item;
//Add the value changed event handler
this.objMultiSelect.ValueChanged += new EventHandler(this.OnValueChanged);
ICheckedItemList list = this.objMultiSelect.Items.ValueList as ICheckedItemList;
list.SetCheckState(0,CheckState.Checked);
Any ideas?
Thanks
Hello joeleesin,
I think that from the provided code only the line before the last could cause such behavior. I also tested this, have clicked and marked on/off all of the items in the editor and did not get any exception. So this code might not be enough to determine what causes this issue. Please if possible attach a small sample project with your scenario, I will be happy to take a look at it.
I've fixed the issue and it has nothing to do with the code. The infragistics2.Win.UltraWinEditors.dll that I used was out of date.
What I did to fix this issue was, update infragistics license to 10.2.20102.2058 and attached a new dll file.
Thanks,
Joe