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
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.
Regards,
Bagavathi Perumal A
Hi,
First of all thank you for responding
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
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
Hi Ammar,
Sorry for the delay in getting back to you.
Regards,
Gokul T