user222706
user222706

Reputation: 11

Grid view in VB.NET

How can I retrieve data from a gridview to text box in VB.NET? I want to select the first row of values (suppose that it contains:rollno and name) and to display it in textbox1 and textbox2. That is, I want to display the values of selected rows.

Upvotes: 1

Views: 1030

Answers (1)

Adriaan Stander
Adriaan Stander

Reputation: 166576

You can try something like this

Dim d As DataTable
d = DataGridView1.DataSource
TextBox1.Text = d.Rows(0)("rollno")

Upvotes: 1

Related Questions