Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
清除datagridview时,C#Windows窗体DataGridViewComboxCell无效_C#_Asp.net_Windows Forms Designer - Fatal编程技术网

清除datagridview时,C#Windows窗体DataGridViewComboxCell无效

清除datagridview时,C#Windows窗体DataGridViewComboxCell无效,c#,asp.net,windows-forms-designer,C#,Asp.net,Windows Forms Designer,我有一个带有datagridviewcombobox的Datagridview 将根据windows窗体搜索条件填充网格 搜索后,网格中填充了结果,组合框中也填充了一些值 进行一些操作后,应清除网格 Status.Items.Clear(); grd.Rows.Clear() 我得到了这个错误 DataGridViewComboxCell值在grd.Rows.Clear()行无效 另外,我并没有直接将数据源分配给网格 我们将每个列映射为 grid.Rows[index].Cells[“XYZ”]

我有一个带有datagridviewcombobox的Datagridview

将根据windows窗体搜索条件填充网格

搜索后,网格中填充了结果,组合框中也填充了一些值

进行一些操作后,应清除网格

Status.Items.Clear(); grd.Rows.Clear()

我得到了这个错误

DataGridViewComboxCell值在grd.Rows.Clear()行无效

另外,我并没有直接将数据源分配给网格

我们将每个列映射为

grid.Rows[index].Cells[“XYZ”].Value

此外,单击该列时将填充组合框


cmbdrpdown.Items.Add('test')

我打赌您正在使用数据源填充DataGridView组合框是否为数据绑定?请添加更多有关DataGridView的设置和使用的代码。@Jyo您说组合框将被填充,组合框本身是否以编程方式添加?