本文介绍了在数据网格的DataGridViewComboBoxColumn中设置默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好, 我有一个数据网格,在那个数据网格中,有一个类型为DataGridViewComboBoxColumn的列.通过设计器,我可以在该combobox中添加元素.但是我想在那个combobox.me中显示默认值.我想在combobox中显示选择"作为默认值.我该怎么做? 请帮忙!
Hello , I have one datagrid,in that datagrid ,there is one column of type DataGridViewComboBoxColumn. through designer it is possible to me add element in that combobox.But i wants to display default value in that combobox.means i want to display "select" as default value in combobox.how can i do this? Please help!
推荐答案像这样尝试: Try like this : ddlTest.DataSource = DataTable; ddlTest.DataTextField = "ID"; ddlTest.DataValueField = "Name"; ddlTest.DataBind(); ddlTest.Items.Insert(0, new ListItem("Select", "0"));
更多推荐
在数据网格的DataGridViewComboBoxColumn中设置默认值
发布评论