请问一下,C# Winform程序关于DataGridView中ComboBox的问题~~~
下面这段代码是更新DataGridView中ComboBox下拉选项的代码,通过调用该函数能修改下拉选项的内容。现在的问题是点击ComboBox始终无法下拉,各位请看看是...
下面这段代码是更新DataGridView中ComboBox下拉选项的代码,通过调用该函数能修改下拉选项的内容。现在的问题是点击ComboBox始终无法下拉,各位请看看是什么原因?
private void DrawSourceField()
{
string sheetname = this.comboBox_src.SelectedItem.ToString().Trim();
Bll.UseExcel ue = new UseExcel();
string[] fieldname = (ue.GetExcelFieldName(excel, sheetname) + ",空").Split(',');
int num = this.dataGridView1.Rows.Count;
for (int i = 0; i < num; i++)
{
DataGridViewComboBoxCell cell = (DataGridViewComboBoxCell)dataGridView1.Rows[i].Cells[1];
foreach (string temp in fieldname)
{
cell.Items.Add(temp);
}
}
} 展开
private void DrawSourceField()
{
string sheetname = this.comboBox_src.SelectedItem.ToString().Trim();
Bll.UseExcel ue = new UseExcel();
string[] fieldname = (ue.GetExcelFieldName(excel, sheetname) + ",空").Split(',');
int num = this.dataGridView1.Rows.Count;
for (int i = 0; i < num; i++)
{
DataGridViewComboBoxCell cell = (DataGridViewComboBoxCell)dataGridView1.Rows[i].Cells[1];
foreach (string temp in fieldname)
{
cell.Items.Add(temp);
}
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询