我的winform上有一个datagridview,它从我的数据库中返回搜索结果。搜索返回后,我想从指定的列中删除null行。下面是一个例子:

假设我想删除类型#2列上具有空值的行。
我完全被卡住了。我该怎么做呢?
发布于 2013-01-21 06:53:52
var rowsNull = (from a in dataGridView1.Rows.Cast<DataGridViewRow>()
where a.Cells[2].Value == null
select a).ToList();
foreach (DataGridViewRow item in rowsNull)
{
dataGridView1.Rows.RemoveAt(item.Index);
}https://stackoverflow.com/questions/14429491
复制相似问题