DataGridView DataGridViewComboBoxColumn 导入数据的问题
小弟 在做DataGridView DataGridViewComboBoxColumn 编辑数据的时候遇到一个问题,就是在页面(Load的时候)把值怎么赋值给绑定好DataGridViewComboBoxColumn控件private void OrderUpdate_Load(object sender, EventArgs e)
{
DataTable table = new DataTable();
table.Columns.Add("SettleTypeId", typeof(int));
table.Columns.Add("SettleTypeName", typeof(string));
string[] Arr_SettleTypeItem = Enum.GetNames(typeof(SettleType));
for (int i = 0; i < Arr_SettleTypeItem.Length; i++)
{
table.Rows.Add(new object[] { (int)PubEnumName.GetSettleTypeByString(Arr_SettleTypeItem[i]), PubEnumName.GetSettleTypeName((int)PubEnumName.GetSettleTypeByString(Arr_SettleTypeItem[i])) });
}
Cob_SettleType.DataSource = table;
Cob_SettleType.ValueMember = "SettleTypeId";
Cob_SettleType.DisplayMember = "SettleTypeName";
}
绑定好了 想在页面导入的时候 从数据库中读取值赋值给Cob_SettleType 该怎么做?Cob_SettleType 没有SelectedIndex属性...