2 Replies - 13334 Views - Last Post: 02 June 2010 - 12:19 PM Rate Topic: -----

#1 Albert Pinto  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 16-May 10

how to get the selected value of datagridview in textbox in vb.net

Posted 30 May 2010 - 03:41 AM

Hi....
I'm using Visual Studio 2005 and Mysql as my Database. Just wanted vb.net code to load data from datagrid to textbox.
(I mean, provide a load button to the form, which after clicking will load the particular row in the respective textboxes )
Thanx...
Is This A Good Question/Topic? 0
  • +

Replies To: how to get the selected value of datagridview in textbox in vb.net

#2 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: how to get the selected value of datagridview in textbox in vb.net

Posted 30 May 2010 - 03:53 AM

hi there :)
it is not rly hard:
        For Each RW As DataGridViewRow In myDataGrid.SelectedRows
            'Send the first cell value into textbox'
            TextBox1.Text = RW.Cells(0).Value.ToString
        Next



hope it helps you :)
Was This Post Helpful? 0
  • +
  • -

#3 Albert Pinto  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 16-May 10

Re: how to get the selected value of datagridview in textbox in vb.net

Posted 02 June 2010 - 12:19 PM

Thanx.......... It worked....!
Thanx a lot.....
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1