How to get the TEXT of Datagridview Combobox selected item?

前端 未结 5 794
渐次进展
渐次进展 2021-02-04 14:04

How to get the Combobox selected item text which is inside a DataGridView? I have tried using the below code:

dataGridView1.Rows[1].Cells[1].Val         


        
5条回答
  •  被撕碎了的回忆
    2021-02-04 15:00

    Also try this:

    DataGridView.CurrentRow.Cells(Column.name).EditedFormattedValue.ToString()
    

    EditedFormattedValue object gives the current, formatted value of the cell in DataGridView, regardless of the cell is edited or in edit mode. It's more convenient to capture the ComboBox selection or any value of cell in DataGridView.

提交回复
热议问题