First, here's a quick correction to the code in the last post:
vb.net Code:
For Each row As DataGridViewRow In myDataGridView.Rows
row.Selected = (CDate(DirectCast(row.DataBoundItem, DataRowView)("InvoiceDate")) = someDate)
Next
Now, to answer your other questions:
vb.net Code:
For Each row As DataGridViewRow In myDataGridView.Rows
With DirectCast(row.DataBoundItem, DataRowView)
row.Selected = (CDate(.Item("OrderDate")) = someDate AndAlso CInt(.Item("ProductID")) = someID)
End With
Next
vb.net Code:
For Each row As DataGridViewRow In myDataGridView.Rows
row.Selected = (CStr(DirectCast(row.DataBoundItem, DataRowView)("FirstName")) LIKE "a*")
Next