MultiColumn combobox dropdown doesn't close even after focus is shifted to another control

Hi,

While working on my app I noticed an annoying problem, I designed my application in such a way that if a user were to press (Control + I) keys a row would be added to the DataGridView and focus will be shifted to the first column of the new row


Everything else works fine but whenever the current active control is the MultiColumnComboBox and the drop-down menu is open the focus isn't shifted to the datagridview cell rather it is fixated on the multicolumn combobox EVEN THOUGH I set the droppeddown property to false ​this is undesirable behaviour


Why is the combobox drop-down still open? Why am I FORCED to select an entry before moving on?

This is all the relevant code


            /*

             * =======================

             * Supplier

             * =======================

             */


            supplierMultiColumnComboBox.DataSource = new SupplierInfoCollection().SupplierListDetails;

            supplierMultiColumnComboBox.ShowColumnHeader = false;

            supplierMultiColumnComboBox.DisplayMember = "Name";

            supplierMultiColumnComboBox.ValueMember = "Name";

            supplierMultiColumnComboBox.MultiColumn = true;

            supplierMultiColumnComboBox.AllowFiltering = true;

            supplierMultiColumnComboBox.TextBox.Text = String.Empty;

            supplierMultiColumnComboBox.AutoComplete = false;



           // Keystrokes

                if (keyData == (Keys.Control | Keys.I))

                {

                    DataGridViewHelper.AddRows(dataGridView1);

                    return true;

                }


// Add rows

        public static void AddRows(DataGridView dataGridView)

        {

            dataGridView.AllowUserToAddRows = true;

            dataGridView.Rows.Add();

            dataGridView.AllowUserToAddRows = false;

            dataGridView.Select();


            int row = dataGridView.Rows.Count - 1;

            dataGridView.CurrentCell = dataGridView.Rows[row].Cells[0];

        }


Please respond as soon as possible

Thank you


4 Replies

BA BagavathiPerumal Apranandham Syncfusion Team July 13, 2022 01:40 AM UTC

Hi Ammar,

Sorry for the delay in getting back to you,

We have created a sample with MultiColumnComboBox and textbox. It works fine without hosting MultiColumnComboBox in the DataGirdView. Please provide following details, to investigating further.

  1. How to you host MultiColumnComboBox inside a DataGridView.
  2. How do you open dropdown of MultiColumnComboBox programmatically.
  3. If possible, please share a simple sample with replication steps.



Regards,
Bagavathi Perumal A


Attachment: WindowsFormsAppMultiColumnComboBox_1ea9069f.zip


AM Ammar replied to BagavathiPerumal Apranandham July 14, 2022 10:27 AM UTC

Hi,


First of all thank you for responding


  1. I am not hosting MultiColumnComboBox inside the DataGridView those two are separate, I'm speaking about shifting focus from one control to another
  2. In the "Enter" event associated with the control I added this line of code 
  3.             supplierMultiColumnComboBox.DroppedDown = true;

    3. I'm busy with work so for now I can provide this screenshot as a reference



    As you can see the supplier combobox is in the top right corner of the form what I'm trying to do is to shift focus as soon as (CTRL + I) is pressed to the GridView but in case the supplier combobox is dropped down this interferes with the desired behavior



    I hope this is enough but if you require more details let me know

    Thank you and have a good day



AM Ammar July 18, 2022 05:50 AM UTC

I will appreciate a solution to my problem as I've been waiting for around 4 days at this point

Please let me know if there is any possible resolution to this problem



GT Gokul Thanudhas Syncfusion Team July 18, 2022 03:58 PM UTC

Hi Ammar,


Sorry for the delay in getting back to you.


We are unable to reproduce the issue from our end. We have prepared a sample based on your requirement. Please refer to the sample and the video for your reference.


If we misunderstood your query, please provide us with more information about your query. So that we can prompt a better solution.


Regards,

Gokul T


Attachment: Multicolumncolombobox_cf0838ca.zip

Loader.
Up arrow icon