Results 1 to 9 of 9

Thread: Input data into a textbox and output into a datagridview?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    3

    Question Input data into a textbox and output into a datagridview?

    I am COMPLETELY new to all of this so excuse my simple mind! I am doing some practice and one of the examples is to create a program in C# where information for at least 10 employees is entered. So each employee has ID, name, surname and salary.

    I decided to use a gridview to display the data and created a class called Employee and I have constructors and methods.

    My question is how do I get what I put into the textboxes to come out to the gridview? I'm completely confused Sorry if it's v. simple

    I'm using VB 2010 btw. Thanks for any help!

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

    Re: Input data into a textbox and output into a datagridview?

    Quote Originally Posted by scheine View Post
    I am doing some practice and one of the examples is to create a program in C#
    Quote Originally Posted by scheine View Post
    I'm using VB 2010 btw
    I just want to make absolutely sure that you really are using VB and not C#.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    3

    Re: Input data into a textbox and output into a datagridview?

    OH sorry I'm using Visual Studio! It has to be in C#, sorry. My mind is frazzled

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

    Re: Input data into a textbox and output into a datagridview?

    In that case I'll ask the mods to move this thread from the VB forum to the C# forum.

  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2012
    Posts
    3

    Re: Input data into a textbox and output into a datagridview?

    Thank you, sorry for that!

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    Re: Input data into a textbox and output into a datagridview?

    Thread moved from the 'VB.Net' forum to the 'C#' forum

    (thanks for letting us know jmcilhinney )

  7. #7
    Frenzied Member MattP's Avatar
    Join Date
    Dec 2008
    Location
    WY
    Posts
    1,227

    Re: Input data into a textbox and output into a datagridview?

    What code do you have so far?

    Are you storing the data in a DataTable and binding the DataGridView to that or just trying to add the data directly to the DataGridView?
    This pattern in common to all great programmers I know: they're not experts in something as much as experts in becoming experts in something.

    The best programming advice I ever got was to spend my entire career becoming educable. And I suggest you do the same.

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

    Re: Input data into a textbox and output into a datagridview?

    Now that we're in the correct forum, can we have some more specific details? I'm guessing that the idea here is that you enter data into some TextBoxes and then click a Button and the data is added to the grid as a new record. Correct?

  9. #9
    Fanatic Member AceInfinity's Avatar
    Join Date
    May 2011
    Posts
    696

    Re: Input data into a textbox and output into a datagridview?

    You can query the Class properties. I would create an array or list of the class for Employees, and then for each, display into the DataGridView.

    You can easily do this by making it your datasource.
    <<<------------
    Improving Managed Code Performance | .NET Application Performance
    < Please if this helped you out. Any kind of thanks is gladly appreciated >


    .NET Programming (2012 - 2018)
    ®Crestron - DMC-T Certified Programmer | Software Developer
    <<<------------

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