Results 1 to 2 of 2

Thread: Click on TreeView nodes display data on GridView.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2010
    Posts
    229

    Click on TreeView nodes display data on GridView.

    Hi,
    Present i am working on TreeView Control.
    By using Treeview control i want to show the data on the DataGridView2.
    This data is coming from DataGridview1 which is hide on the output.
    When i click on the selected node that perticular node is connect to suitable data on the datagridview1. Then that data or that Row is display on the Datagridview2.

    Example:

    Assume in my Datagridview1 the first column is contains data 3101,3102,3103.....
    In my Treeview control i added nodes like 3101,3102,3103.......
    So when i select or click the 3101, that is connect to 3101 Row in the DataGridview1. That hole row is dislay on the DataGirdview2.


    I hope u understand my problem.
    Regards
    Kumar.

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

    Re: Click on TreeView nodes display data on GridView.

    You don't need two grids. A grid is for display and input purposes, not storage. If the first grid isn't being displayed to the user then get rid of it. Just store the data in a DataTable or some other list. On the AfterSelect event of the tree, you can get the appropriate record from the list and display it in the one and only grid. If you use a DataTable, you can also bind the entire table to the grid via a BindingSource and then set the BindingSource's Filter property to hide all but the desired row.
    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

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