Unplanned
Last Updated: 20 Mar 2023 11:40 by ADMIN
Julian
Created on: 20 Mar 2023 11:26
Category: MultiColumnCombo
Type: Bug Report
1
RadMultiColumnComboBox: Enabled ScrollOnMouseWheel skips every second entry

Use the following code and try to scroll item by item with the mouse wheel:

        public RadForm1()
        {
            InitializeComponent();

            DataTable dt = new DataTable();
            dt.Columns.Add("Id", typeof(int));
            dt.Columns.Add("Name", typeof(string));
            for (int i = 0; i < 20; i++)
            {
                dt.Rows.Add(i, "Item"+i);
            }
            this.radMultiColumnComboBox1.DisplayMember = "Name";
            this.radMultiColumnComboBox1.ValueMember = "Id";
            this.radMultiColumnComboBox1.DataSource = dt;
            this.radMultiColumnComboBox1.ScrollOnMouseWheel = true;
            this.radMultiColumnComboBox1.SelectedValueChanged+=radMultiColumnComboBox1_SelectedValueChanged;
        }

        private void radMultiColumnComboBox1_SelectedValueChanged(object sender, EventArgs e)
        {
            Console.WriteLine("Value: "+this.radMultiColumnComboBox1.SelectedValue);
        }

Expected behavior: one item is scrolled at a time

Actual behavior: two items are scrolled at a time

Note: RadDropDownList behaves as expected.

 

Attached Files:
1 comment
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 20 Mar 2023 11:40

Hello, Julian,

Thank you for reporting this undesired behavior.

The possible solution that I can suggest is to manage programmatically the selected item: 

            this.radMultiColumnComboBox1.ScrollOnMouseWheel = false;
            this.radMultiColumnComboBox1.MultiColumnComboBoxElement.TextBoxElement.TextBoxItem.TextBoxControl.MouseWheel += TextBoxControl_MouseWheel;

        private void TextBoxControl_MouseWheel(object sender, MouseEventArgs e)
        {
            if (e.Delta > 0)
            {
                this.radMultiColumnComboBox1.EditorControl.GridNavigator.SelectPreviousRow(1);
            }
            else
            {
                this.radMultiColumnComboBox1.EditorControl.GridNavigator.SelectNextRow(1);
            }
        }

I hope this information helps. 

Regards,
Dess | Tech Support Engineer, Principal
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/.