I have a DataGridView with 3 columns (metric_key, metric_name, metric_value).
There are for example, 6 ROWS in this table (6 different metrics), ad
There isn't a built in way to do this. But you can define an extension method on DataGridView to accomplish this.
_
Function FindValue(ByRef dgv As DataGridView, ByVal metric_key As Object) As DataGridViewRow
For Each row As DataGridViewRow In dgv.Rows
If row.Cells.Item("metric_value").Value = metric_key Then
Return row
End If
Next
Return Nothing
End Function
So if you wanted to get the row where the metric_value is 1, you could use
dataGridView1.FindValue(1)