I have a datagrid and I want the data in the selected row to be shown in a textbox. I am using .NET 2003. All I found is the solution for datagridview. I tried this code and also SelectedRows but the function does not exist in datagrid.
Private Sub Grid2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Grid2.SelectedIndexChanged
Dim i, j As Integer
i = Grid2.CurrentRow.Index
TextBox1.Text = Grid2.Item(0, i).Value
TextBox2.Text = Grid2.Item(1, i).Value
TextBox3.Text = Grid2.Item(2, i).Value
TextBox4.Text = Grid2.Item(3, i).Value
End Sub