Thanks for your replies SAKryukov and Manoj K Bhoir.
My problem was in the LostFocus sub on the "search text box"
I had is set to clear the rows in the datagrid when lost focus, and display "Enter Search Text Here..." so as soon as I click datagrid, the rows were cleared. (This was nice because when you have finished searching, and you click somwhere else, all the search rows are 'nice and clean'
I removed the code from LostFocus, and replaced it in the Click and DoubleClick events of the datagrid and now it works ok.
Private Sub dgvStkEnqSearchResults_DoubleClick(sender As Object, e As System.EventArgs) Handles dgvStkEnqSearchResults.DoubleClick, dgvStkEnqSearchResults.Click
If Not IsNothing(Me.dgvStkEnqSearchResults.CurrentRow) Then
Dim currentrow As Integer = dgvStkEnqSearchResults.CurrentRow.Index
Me.txtStockEnquiry_StockCode.Text = dgvStkEnqSearchResults.Rows(currentrow).Cells("StockCode").Value
txtStkEnqSearchText.Text = "Enter Search Text here..."
txtStkEnqSearchText.ForeColor = Color.DimGray
End If
End Sub
Private Sub txtStkEnqSearchText_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtStkEnqSearchText.GotFocus
If txtStkEnqSearchText.Text = "Enter Search Text here..." Then
txtStkEnqSearchText.Text = ""
txtStkEnqSearchText.ForeColor = Color.Black
dvSearch.RowFilter = "CodeDesc LIKE '%" & Me.txtStkEnqSearchText.Text & "%'"
End If
End Sub