Where is the best place to put your code to get the row/cell data after a user selects a datagridview row?
I notice that as soon as my app starts the code below fires even before the form opens.
Also I get an error on the first line stating object not set or an error for the second row of index out of range?
I want to store each cell from the selected row into their corresponding string variables.
Thnx
I notice that as soon as my app starts the code below fires even before the form opens.
Also I get an error on the first line stating object not set or an error for the second row of index out of range?
I want to store each cell from the selected row into their corresponding string variables.
VB.NET:
Private Sub dgvUndelivered_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgvUndelivered.SelectionChanged
strDetail = Me.dgvUndelivered.SelectedRows(0).Cells("ORDER").Value
strDetail = Me.dgvUndelivered.SelectedRows(0).Cells(0).Value
Thnx