5 Replies - 17455 Views - Last Post: 10 March 2015 - 05:20 AM 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: 466
  • View blog
  • Posts: 4,262
  • 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
  • +
  • -

#4 AK-479000  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 08-March 15

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

Posted 08 March 2015 - 08:59 AM

quick question, how am i gonna update the datagrid if im going to edit the text showing in that textbox... i have the same problem too... :-(
Was This Post Helpful? 0
  • +
  • -

#5 AK-479000  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 08-March 15

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

Posted 08 March 2015 - 09:22 AM

View PostAK-479000, on 08 March 2015 - 08:59 AM, said:

quick question, how am i gonna update the datagrid if im going to edit the text showing in that textbox... i have the same problem too... :-(


sorry am using VS2013 - trial VB6
Was This Post Helpful? 0
  • +
  • -

#6 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 466
  • View blog
  • Posts: 4,262
  • Joined: 25-March 09

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

Posted 10 March 2015 - 05:20 AM

Hi there,
You're probably using VB.NET with that visual studio. Anyway using TextChange Event in the textbox you can update the datagrid. Give it some try and post us back here with the code that you have worked on if you have more troubles and we will be more then happy to take a look at it and help you :)/>

Best Regards

This post has been edited by raziel_: 10 March 2015 - 05:21 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1