following is the code which i have used while selecting the particular rows column value on pressing the F9 key.but i get the error as argument out of range exception was handled.detailed error comes as index out of range exception.
Private Sub dgsearchitemlist_KeyDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) _
Handles dgsearchitemlist.KeyDown
If e.KeyCode = Keys.F9 Then
itemcode = dgsearchitemlist.SelectedRows(0).Cells(0).Value
description = dgsearchitemlist.SelectedRows(0).Cells(2).Value.ToString
uom = dgsearchitemlist.SelectedRows(0).Cells(3).Value.ToString
End If
End Sub