Completed
Last Updated: 06 Apr 2021 08:33 by ADMIN
Release R2 2021
Michael
Created on: 03 Mar 2021 09:14
Category: CheckedDropDownList
Type: Bug Report
0
RadCheckedDropDownList: ArgumentOutOfRangeException: "Index was out of range" when check new items from the list and rebind the control
I updated the code you sent to exhibit the behavior that we are seeing. Try changing the checked list box using the AutoSuggestMode. Press Save, see that the data disappears in the control, set a breakpoint in the same method, and see that the data Items are correct. Press Reset and see the data come back. And it may even give you the System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index' exception when it tries to set the DataSource on line 39.

Let me know if you need more info.
Attached Files:
1 comment
ADMIN
Nadya | Tech Support Engineer
Posted on: 03 Mar 2021 09:37

Hello, Michael,

To workaround:

private void UpdateListData(BindingList<CheckedItem> items)
{
   // reset all properties and data source
    radCheckedDropDownList1.ValueMember = "";
    radCheckedDropDownList1.DisplayMember = "";
    radCheckedDropDownList1.CheckedMember = "";
    radCheckedDropDownList1.DataSource = null;

    radCheckedDropDownList1.ValueMember = "Id";
    radCheckedDropDownList1.DisplayMember = "Name";
    radCheckedDropDownList1.CheckedMember = "IsChecked";
    radCheckedDropDownList1.DataSource = items;
    radCheckedDropDownList1.ShowCheckAllItems = true;
    radCheckedDropDownList1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
}

I hope this helps.

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Attached Files: