Monday, 18 April 2016

Get Record gridview to window control by select a row form gridview


Private Sub DataGridView1_RowHeaderMouseClick_1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.RowHeaderMouseClick

        Dim dr As DataGridViewSelectedRowCollection
        dr = DataGridView1.SelectedRows()
        lblid.Text = dr.Item(0).Cells(1).Value.ToString()
        lblName.Text = dr.Item(0).Cells(0).Value.ToString()
        TextBox1.Text = dr.Item(0).Cells(0).Value.ToString()
    End Sub

Next Topic

No comments:

Post a Comment