Adding ComboBox to a datagridview for a particular row

后端 未结 2 1786
Happy的楠姐
Happy的楠姐 2021-01-07 00:26

I have a requirement to show drop down list to one particular row among several rows. My dataGridView has 2 columns (Parameter and Value) and I am adding 3 rows dynamically

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-07 00:38

    Please consider adding of ComboBox column to grid with right-click context menu item Edit Columns... of the grid in Form Designer. To add column it will require to click on Add button of Edit Columns dialog and subsequently select Type = DataGridViewComboBoxColumn as shown below:

    enter image description here

    Please note: You will also need to use either Items or DataSource property of the column to populate drop-down list of the ComboBox.

提交回复
热议问题