如何使用String列表的键在DataGridView
中查找行?我将单元格值与具有相同列的另一个网格进行比较...
Private key As New List(Of String)
Dim rowFromAnotherGrid As DataGridViewRow
...
Me.key = New List(Of String) From {"Key1", "Key2"}
Dim row As DataGridViewRow
'This is obviously wrong - Expression does not produce a value:
row = (From r In Me.grid.Rows
Where Me.key.ForEach(Function(subkey)
Return r.Cells(subkey).Value = rowFromAnotherGrid.Cells(subkey).Value
End Function)).FirstOrDefault
差不多吧还是有更好的办法?
1条答案
按热度按时间bweufnob1#
好吧,我是这样做的,还是相信有更好的解决办法:
...