Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi everybody

how can i change selectedindex comboboxcell in datagridview?

example:
In my datagridview there are two combobox columns
when I change the first combobox selecteditem then second combobox change automaticaly

What I have tried:

VB
Dim cbCell, cbCell1 As New DataGridViewComboBoxCell
 cbCell = ODEME_BILGILER.Rows(ODEME_BILGILER.CurrentRow.Index).Cells(1)
 cbCell1 = ODEME_BILGILER.Rows(ODEME_BILGILER.CurrentRow.Index).Cells(2)
 cbCell.Items.SelectedIndex = cbCell1.Items.SelectedIndex
Posted
Updated 25-May-20 19:29pm
v2

1 solution

A DataGridViewComboBoxCell has no SelectedIndex or SelectedValue property but you can set the value, see answer here:
Set selectedindex for comboboxcell in datagridview vb.net - Stack Overflow[^]
 
Share this answer
 
Comments
Maciej Los 26-May-20 2:10am    
5ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900