943,544 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 3316
  • C# RSS
Feb 9th, 2009
0

direct mapping from treeview to datagridview

Expand Post »
hi,

i am doing some windows application program using .net.

i show the information in treeview. when user selects the data from treeview. i like to show in datagrid view.

i do't know any direct mapping is present or not. if present please share ur ideas.

(now currently i m collect the tree node and add that information into datagridview.)
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
karthi_selva is offline Offline
65 posts
since Oct 2008
Feb 9th, 2009
0

Re: direct mapping from treeview to datagridview

If you want to show detailed data on GridView based on master data on TreeView, say TreeView holds Car Models and you need when use selects Car Model from TreeView, its details shows in GridView.
You'd have DataSource which takes Car Model as a parameter, and assign GridView.DataSource to it, when user selects node send its name to the DataGrid DataSource to fill it.
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006
Feb 9th, 2009
0

Re: direct mapping from treeview to datagridview

hi,

i got some idea. if possible give some syntax. its useful for my reference.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
karthi_selva is offline Offline
65 posts
since Oct 2008
Feb 9th, 2009
0

Re: direct mapping from treeview to datagridview

Hi,
Use TreeView.AfterSelect event to fill the Grid, it gets fire when node has been selected. Here you can assign the data associated with selected node, to the GridView.
Reputation Points: 165
Solved Threads: 59
Posting Pro in Training
DangerDev is offline Offline
485 posts
since Jan 2008
Feb 9th, 2009
0

Re: direct mapping from treeview to datagridview

Quote ...
if possible give some syntax. its useful for my reference.
As you understand the solution, coding is easier...
Featured Poster
Reputation Points: 480
Solved Threads: 276
Postaholic
Ramy Mahrous is offline Offline
2,189 posts
since Aug 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Icons from SQL to ToolStripMenuItem ?
Next Thread in C# Forum Timeline: How I use IsMdiConteiner





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC