Completed
Last Updated: 30 Nov 2017 08:28 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 21 Nov 2017 09:15
Category:
Type: Bug Report
0
FIX. RadCheckedDropDownList - incorrect ToggleState for the "CheckAll" item when the items are checked programmatically
To reproduce:

        public RadForm1()
        {
            InitializeComponent();

            for (int i = 0; i < 10; i++)
            {
                this.radCheckedDropDownList1.Items.Add("Item" + i, i % 2 == 0);
            }
            this.radCheckedDropDownList1.ShowCheckAllItems = true;
        }

Workaround:

        public RadForm1()
        {
            InitializeComponent();
           
            this.radCheckedDropDownList1.ShowCheckAllItems = true;
            for (int i = 0; i < 10; i++)
            {
                this.radCheckedDropDownList1.Items.Add("Item" + i, i % 2 == 1);
            }
            CheckedItemTraverser traverser = this.radCheckedDropDownList1.ListElement.Scroller.Traverser as CheckedItemTraverser;
            this.radCheckedDropDownList1.ItemCheckedChanging += radCheckedDropDownList1_ItemCheckedChanging;
            traverser.CheckAllItem.Checked = false;
            this.radCheckedDropDownList1.ItemCheckedChanging -= radCheckedDropDownList1_ItemCheckedChanging;
        }

        private void radCheckedDropDownList1_ItemCheckedChanging(object sender, RadCheckedListDataItemCancelEventArgs e)
        {
            if (e.Item.Text != "Check All")
            {
                e.Cancel = true;
            }
        }
0 comments