how to set SelectedIndex in DataGridViewComboBoxColumn?

后端 未结 7 895
慢半拍i
慢半拍i 2021-01-18 04:00

i am using a datagridview in that i am using a datagridviewcomboboxcolumn, comboboxcolumn is displaying text but the problem is i want to select the first item of comboboxco

7条回答
  •  轮回少年
    2021-01-18 05:00

    The values available in the combobox can be accessed via items property

    row.Cells[col.Name].Value = (row.Cells[col.Name] as DataGridViewComboBoxCell).Items[0];
    

提交回复
热议问题