Results 1 to 5 of 5

Thread: [RESOLVED] DataGridView

  1. #1

    Thread Starter
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Resolved [RESOLVED] DataGridView

    Is there a way to programmatically send information from a text box into specific columns in a DataGridView?

    I tried
    vb.net Code:
    1. Column1.Text = TextBox1.Text
    and it obviously does not work.

    Thanks
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

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

    Re: DataGridView

    Consider where you actually want the text to appear. It's not just in the column, is it? It's in a specific cell in that column. You need to specify the appropriate row in the grid, then specify the appropriate cell in that row, then set its Value property, e.g.
    vb.net Code:
    1. myDataGridView.Rows(0).Cells(0).Value = myTextBox.Text
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: DataGridView

    Thanks, jmcilhinney.

    By the way, do you have any tutorials on DataGridViews that you would recommend? I've looked at a couple, but the ones I've come into aren't very explanatory.

    Thanks
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  4. #4
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    Re: DataGridView

    Check out this link. There is a VERY nice FAQ document and also some examples. I have that document on my desktop for safe keeping.

    http://social.msdn.microsoft.com/For...b-e76ac21c1cd4
    My.Settings.Signature = String.Empty

  5. #5
    Addicted Member
    Join Date
    Nov 2008
    Posts
    163

    Re: DataGridView

    also search through a few of my threads about datagridview

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