How to set value to DataGridViewComboBox Column?

前端 未结 5 1505
盖世英雄少女心
盖世英雄少女心 2020-12-09 21:51

I want to know how to set the value of a DataGridViewComboBox cell. I already bind the DataGridViewComboBox with DataSource. But I want to set new value to this this datasou

5条回答
  •  臣服心动
    2020-12-09 22:18

    There is a way to set the value but it is not allowed if DataSource is set.

    DataGridViewComboBoxCell cell =(DataGridViewComboBoxCell)gvList.Rows[0].Cells[0];
    cell.Items[0] = "Select";
    

提交回复
热议问题