您的位置:首页 > 编程语言 > C#

C# DataGridView设置某一格为组合框

2015-08-20 11:45 591 查看
DataGridView的格为Cell,设置某一格为组合框,只要该cell为组合框就可以了。
代码示例:
DataGridViewComboBoxCellcbxCmbCell = new DataGridViewComboBoxCell();
cbxCmbCell.DataSource= null; //自行添加数据

dataGridBack.Rows.Add(); //dataGridBack为要修改的DataGridView
dataGridBack[1,0]= cbxCmbCell; // dataGridBack[1,0]为0行一列的单元格

设置成功。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: