组合框默认显示一个空白领域,即使组合框填入一个数值设置默认值到的DataGridViewComboBoxCell
ColumnSpeed.DataSource = speedList;
ColumnSpeed.ValueType = typeof(string);
我也试过以下的,但它仍然显示空白文本。
foreach (DataGridViewRow row in myDataGridView.Rows)
{
DataGridViewComboBoxCell cell = row.Cells[ColumnSpeed.Index] as DataGridViewComboBoxCell;
if (cell != null)
{
cell.DataSource = speedList;
cell.Value = cell.Items[0].ToString();
}
}
嗨,我试图玩DataGridView,它适用于我的两种方式。你能提供更多的代码吗? – Ikaso 2010-03-01 19:50:11