Completed
Last Updated: 26 Mar 2015 08:00 by ADMIN
ADMIN
Stefan
Created on: 03 Mar 2015 06:19
Category: MultiColumnCombo
Type: Bug Report
1
FIX. RadMultiColumnComboBox - having AutoFilter=true, typing a filter and pressing Esc or moving the focus away, fires SelectedIndexChanged, while it shouldn't
To reproduice:
1. Add mccb and bind it:
            Random random = new Random();
            DataTable dataTable = new DataTable();
            dataTable.Columns.Add("ID", typeof(int));
            dataTable.Columns.Add("Name", typeof(string));
            dataTable.Columns.Add("Bool", typeof(bool));
            dataTable.Columns.Add("DateColumn", typeof(DateTime));
            for (int i = 0; i < 20; i++)
            {
                dataTable.Rows.Add(i, "Row " + i, random.Next(10) > 5 ? true : false, DateTime.Now.AddDays(i));
            }
            this.radMultiColumnComboBox1.DataSource = dataTable;
            this.radMultiColumnComboBox1.DisplayMember = "Name";
            this.radMultiColumnComboBox1.ValueMember = "Name";

2. Add filter and subscribe to the event:
            radMultiColumnComboBox1.AutoFilter = true;

            FilterDescriptor filter = new FilterDescriptor();
            filter.PropertyName = "Name";
            filter.Operator = FilterOperator.Contains;

            this.radMultiColumnComboBox1.EditorControl.MasterTemplate.FilterDescriptors.Add(filter);
            radMultiColumnComboBox1.SelectedIndexChanged += radMultiColumnComboBox1_SelectedIndexChanged;

        void radMultiColumnComboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Console.WriteLine(string.Format("Row changed, current Name = {0}", radMultiColumnComboBox1.EditorControl.Rows[radMultiColumnComboBox1.SelectedIndex].Cells["Name"].Value));
        }

3. Start the app the selected row is "Row 0". Type in "2", the popup will open showing rows "Row 2" and "Row 12". At this point, pressing Esc or moving the focus away from the control selected Row 2, while it shouldn't.

(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments