Completed
Last Updated: 07 Mar 2016 08:37 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 29 Feb 2016 08:52
Category:
Type: Bug Report
0
IMPROVE. RadCheckedDropDownList - unchecking all items is slow
this.radCheckedDropDownList1.ShowCheckAllItems = true;

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

Workaround:

this.radCheckedDropDownList1.ItemCheckedChanging += radCheckedDropDownList1_ItemCheckedChanging;

private void radCheckedDropDownList1_ItemCheckedChanging(object sender, Telerik.WinControls.UI.RadCheckedListDataItemCancelEventArgs e)
{
    if (e.Item == this.radCheckedDropDownList1.CheckedDropDownListElement.CheckAllItem)
    {
        e.Cancel = true;
        this.radCheckedDropDownList1.ItemCheckedChanging -= radCheckedDropDownList1_ItemCheckedChanging;
        this.radCheckedDropDownList1.CheckedDropDownListElement.BeginUpdate();
        e.Item.Checked = !e.Item.Checked;
        StringBuilder sb = new StringBuilder();
        foreach (RadCheckedListDataItem item in this.radCheckedDropDownList1.Items)
        {
            item.Checked = e.Item.Checked;
            if (item.Checked)
            {
                sb.Append(item.Text + ";");
            }
        }    this.radCheckedDropDownList1.CheckedDropDownListElement.EditableElementText = sb.ToString();
        this.radCheckedDropDownList1.CheckedDropDownListElement.EndUpdate();
    
        
        this.radCheckedDropDownList1.ItemCheckedChanging += radCheckedDropDownList1_ItemCheckedChanging;
    }
}
0 comments