Completed
Last Updated: 30 Mar 2017 07:54 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 05 Sep 2016 13:29
Category: ListView, CardView and CheckedListBox
Type: Bug Report
1
FIX. RadCheckedDropDownList - removing checked items in BeginUpdate/EndUpdate block doesn't reset the editable part
To reproduce: use the following code:

public Form1()
{
    InitializeComponent();

    for (int i = 0; i < 200; i++)
    {
        this.radCheckedDropDownList1.Items.Add("Item" + i);
    }
}

private void radButton1_Click(object sender, EventArgs e)
{
    this.radCheckedDropDownList1.ListElement.BeginUpdate();
    foreach (RadCheckedListDataItem item in this.radCheckedDropDownList1.Items)
    {
        if (item.Index % 2 == 0)
        {
            item.Checked = true; 
        }
    }
    this.radCheckedDropDownList1.ListElement.EndUpdate();
}

private void radButton2_Click(object sender, EventArgs e)
{
    BindingList<RadCheckedListDataItem> checkedItems = new BindingList<RadCheckedListDataItem>();
    for (int i = 0; i < this.radCheckedDropDownList1.CheckedItems.Count; i++)
    {
        checkedItems.Add(this.radCheckedDropDownList1.CheckedItems[i]);
    }
    
    this.radCheckedDropDownList1.ListElement.BeginUpdate();
    while (checkedItems.Count > 0)
    {
        this.radCheckedDropDownList1.Items.Remove(checkedItems[0]);
        checkedItems.RemoveAt(0);
    }
 
    this.radCheckedDropDownList1.ListElement.EndUpdate();
}

Click the first button to check half of the items. Then click the second button to remove the checked items. In order to optimise performance, the items removing is put in a Begin/EndUpdate block. As a result the items are indeed removed fast, however, the editable part is not synced.
Attached Files:
0 comments