DataGridView set column cell Combobox

后端 未结 8 2087
滥情空心
滥情空心 2020-12-05 19:36

I have tables like that in Datagridview:

 Name   Money
 -------------
 Hi      100   //here Combobox with member {10,30,80,100} to choose
 Ki      30    //he         


        
8条回答
  •  遥遥无期
    2020-12-05 19:59

    You can do that very easily in the Visual Studio designer like this:

    1. Select (left click) the data grid view (DGV)
    2. In the properties of the DGV, click on the link "Edit columns". A dialog opens.
    3. Select the column you want to change to combobox in the "Selected Columns" list
    4. On the right hand side of the dialog, in "Unbound Column properties", "Design" section, find ColumnType property
    5. Change ColumnType property value to DataGridViewComboBoxColumn
    6. Save changes

提交回复
热议问题