首页 文章

在datagridview中搜索特定数据

提问于
浏览
0

我必须处理一个有 datagridview without a datasource. 的项目 . 它也是在vb.net中完成的 . 我想循环遍历特定列上的每一行以查找特定数据并将我的注意力集中在该记录上 .

For Each item As C1.Win.C1FlexGrid.Row In myDataGrid.Rows
    ' something like searchFor/contains 
    ' (no idea, can't find the right way to search) for mySpecificData
Next

感谢您的帮助,最好的问候

1 回答

  • 0

    我假设您正在使用 component One FlexGrid ,所以我在the according site查看了 documentation . 每行都有 Item Property 所以这个例子可能有效

    For Each row As C1.Win.C1FlexGrid.Row In myDataGrid.Rows
        if row.Item("COLUMNNAME") = YOUR_VALUE then
            ' select range
            C1.Win.C1FlexGrid.Select(row.Index, COLUMN_INDEX);
        end if    
    Next
    

    如果您想直接访问单元格,可以使用Select method代替 .

相关问题