Results 1 to 7 of 7

Thread: Help with DataGridView

  1. #1

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Help with DataGridView

    Hi guys! Help please...I have 2 DataGridView, DataGridView1 and DataGirdView2. What I want is, when i double click an item on DataGridView1 I want that item to be copied to DataGridView2..How is this posible? by the way, the 2DataGridView are initially dont have columns defined but when my windows form is load DataGridView1 is filled up by the result of my sql query so the columns in DataGridView1 is defined. Help please..Thanks in advance!

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

    Re: Help with DataGridView

    You get the bound DataRowView from the Current property of your BindingSource. You then call the AddNew method of the second BindingSource and set the fields of the new DataRowView.
    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
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: Help with DataGridView

    Whoowwww...Thanks for that John..but, im just new to DataGrid and honestly, i cant understand the terms...Can you please explain it further, if you can still..or if posible can you please give an example, it may not be exact to what im asking but it could be something that has relevant to my problem...Thanks in advance!

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

    Re: Help with DataGridView

    This has very little to do with the DataGridView (and nothing to do with the DataGrid). You should be binding your DataTables to BindingSource objects, which in turn should be bound to the grids. Everything I said relates to the BindingSource and DataRowView classes. If you want to know about the BindingSource class, its Current property or its AddNew method (you know what I'm going to say don't you) you should read the documentation.
    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

  5. #5

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Talking Re: Help with DataGridView

    This has very little to do with the DataGridView (and nothing to do with the DataGrid).
    Thats the proof for this
    im just new to DataGrid


    (you know what I'm going to say don't you)
    Yah.... read the MSDN...


    Thanks for that John...I'll give it a try..

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

    Re: Help with DataGridView

    Quote Originally Posted by daimous
    Thanks for that John...I'll give it a try..
    When you have, if you still can't get it then post what you've done and I'll be glad to help. I'm always keen to see people have a shot themselves first though.
    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

  7. #7

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: Help with DataGridView

    No prob..
    I'm always keen to see people have a shot themselves first though.
    INDEED! ..Infact everytime i post a questions/problem its always expected that you have always the answer, it may not be the exact answer/solution but still it really helps a lot and really appreciate it!

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