由网友(泽风飘渺)分享简介:我有设置的混乱/获取选择组合框里面的字段的索引。I've got confusion of setting / getting selected indexes of combobox fields inside.this.Parameter.DataSource = lambdacat.Dict();{foreac...
我有设置的混乱/获取选择组合框里面的字段的索引。
I've got confusion of setting / getting selected indexes of combobox fields inside.
this.Parameter.DataSource = lambdacat.Dict();
{
foreach (DataGridViewRow row in LimView.Rows)
{
//( (ComboBox)row.Cells[1] ) ???
}
}
是的,这不工作:)
yes , this doesn't work :)
谢谢
推荐答案
您可以使用
(row.Cells[1] as DataGridViewComboBoxCell).Value == yourvalue;
和获得所选择的值
(row.Cells[1] as DataGridViewComboBoxCell).FormattedValue
要设置默认选定值
(row.Cells[1] as DataGridViewComboBoxCell).Value =(row.Cells[1] as DataGridViewComboBoxCell).Items[yourneededindex]
相关推荐
最新文章