C# winform中datagridview的下拉框怎么用,如何绑定List数据源 本人返回结果集为:List<KeyValuePair<string, string>> list;我将datatable传入子窗口,并绑定到datagridview中,然后要把单元格转换成下拉框的形式,并且将list数据源绑定到下拉框,求大神指点! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 遍历datatable即可,有什么问题! datagridview.datasource = list;datagridview.databind(); 帮定给datagridview中的 下拉框列表 我想要的是将 datagridview 的 DataGridViewTextBoxCell 转成DataGridViewComboBoxColumn 然后将List绑定给 DataGridViewComboBoxColumn ((DataGridViewComboBoxCell)dgvStudentList.Rows[0].Cells["Student"]).DataSource = list;((DataGridViewComboBoxCell)dgvStudentList.Rows[0].Cells["Student"]).ValueMember = "StuNum";((DataGridViewComboBoxCell)dgvStudentList.Rows[0].Cells["Student"]).DisplayMember = "StuName"; 无法将类型为“System.Windows.Forms.DataGridViewTextBoxCell”的对象强制转换为类型“System.Windows.Forms.DataGridViewComboBoxCell”。 这个就可以啊, 你类型无法转换, 说明你选择的那个 CELL 不是 Combobox 列 你写的那列 是 DataGridViewTextBoxCell,不是DataGridViewComboBoxCell,请看清楚 关于treeview数节点判断的问题 winform treeview的问题 关于进程的简单问题 特殊字符串转换成时间 xmlreader如何返回父节点 请教专家一个C的移植问题 一个关于 asp.net 操作Word的问题???? 请高手指点一下。Microsoft.Office.Interop.Word 使用委托出錯......... 跪求:实现系统send to功能 C#求一算法 多窗口文档记事本怎样让菜单栏操作的是当前激活的子窗口 系统是ASP做的,但现在用.net做了个界面,需要挂在系统里,当点连接后报错,无法显示!急
datagridview.datasource = list;
datagridview.databind();
帮定给datagridview中的 下拉框列表
((DataGridViewComboBoxCell)dgvStudentList.Rows[0].Cells["Student"]).DataSource = list;
((DataGridViewComboBoxCell)dgvStudentList.Rows[0].Cells["Student"]).ValueMember = "StuNum";
((DataGridViewComboBoxCell)dgvStudentList.Rows[0].Cells["Student"]).DisplayMember = "StuName";
这个就可以啊, 你类型无法转换, 说明你选择的那个 CELL 不是 Combobox 列