我想得到DataGridViewRow的索引,其第一列的值匹配.
我的代码到目前为止:
string SearchForThis = "test";
int index = from r in dgv.Rows
where r.Cells[0].Value == SearchForThis
select r.Index;
Run Code Online (Sandbox Code Playgroud)
编译错误:
找不到源类型'System.Windows.Forms.DataGridViewRowCollection'的查询模式的实现.'哪里'找不到.考虑明确指定范围变量'r'的类型.