|
-
Oct 1st, 2021, 02:22 PM
#1
[RESOLVED] Strange DGV Behavior
I have a DGV bound to a datatable. I then swap out a column and replace it with a dropdown combo using this code:
Code:
Dim dgvCol As New DataGridViewComboBoxColumn
dgvCol.ValueType = GetType(String)
dgvCol.DisplayMember = "Species"
dgvCol.ValueMember = "Species"
dgvCol.DataSource = mCharacteristics.Tables("Species")
dgvCol.HeaderText = "Species"
dgvCol.DataPropertyName = "Species"
dgvCol.DefaultCellStyle.BackColor = Drawing.Color.White
dgvData.Columns.Remove(dgvData.Columns("Species"))
dgvData.Columns.AddRange(dgvCol)
dgvCol.DisplayIndex = 6
While it works, it does one odd thing. After selecting a value in one row, when I then click on the drop down in the next (or any other) row, the row I just set flashes briefly blue, and nothing else happens. On the second click, the drop down shows up.
That brief blue flash suggests perhaps a change of focus is happening. It would clearly be better for the drop down to appear on the first click, not on the second, though.
I don't have any experience with drop downs in DGV's. What is happening here?
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|