Results 1 to 6 of 6

Thread: Datagridview to multiple textbox

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2019
    Posts
    4

    Red face Datagridview to multiple textbox

    Hi All,

    I am a beginner on using visual basic (Visual Studio 2010) and just want to ask a question on how to link the datagridview to textboxes on click event.

    Scenario:

    I have multiple textbox image shown below:

    Name:  VB.JPG
Views: 305
Size:  23.4 KB

    So when I click to datagridview it should go to textbox1, next click on datagridview should go to textbox2 and so on until I fill all the textbox while searching for the data on datagridview.

    Datagridview is link to a MS access database (small database).

    This is a small data for my project which is I'm having hard time to coding it.

    Glad if someone can help me on this.

    Thanks in advance.
    Last edited by cre3p213; Jun 3rd, 2021 at 08:16 AM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,348

    Re: Datagridview to multiple textbox

    Can you do the first one? ALWAYS break your problem down into smaller parts and address each part separately. Can you be notified when a row is selected? Can you get data from the selected row? Can you put data into TextBoxes? If so then that's the first row into the TextBoxes done, so why would you need to ask us about that part? If not then exactly what part are you having issues with, because they are all separate and distinct. A big part of solving problems is identifying what the actual problem is first, and you haven't really done that here. Although not on such a grand scale, it's much like asking how to build a house, as though pouring concrete, laying bricks, plumbing and the rest aren't all completely separate activities.

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2019
    Posts
    4

    Re: Datagridview to multiple textbox

    The selected data is going on the first text box only. So when I click the second data it just overwrite the first one. As I told I am a beginner and it is my first time to post like this.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,348

    Re: Datagridview to multiple textbox

    I get that you're a beginner. You don't have to keep telling us the same thing. If you can do part of it then show us what you have done. You should have done that in the first place and told us what the actual problem was, not asked us how to do the parts that you can already do. Being a beginner at programming doesn't mean that you disregard everything else you do know about problem-solving.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,348

    Re: Datagridview to multiple textbox

    My point is that, if you show us what you have done, we can show you how to extend it to do the extra part you don't know how to do. If we have no idea what you've done then you may as well not have done it at all because we won't be able to take it into account and we'll have to do the whole thing from scratch.

  6. #6
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,481

    Re: Datagridview to multiple textbox

    For the TextBoxes, you could use a 2D Array, but as JM said, we need to see the progress you have made, then we can advise how to change your code.
    Show us the code that loads the TextBox, tell us the names of your TextBoxes, etc...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width