I have a dataset with tables that map to nodes in a TreeView.
+ Project1 |
+ ConfigA | txtDate
+ Project2 |
+ ConfigB |
On the form that contains the TreeView, there are controls that need to
display other various bits of data associated with each node when the node
is selected in the TreeView. This other data is stored in the same DataSet
in related tables.
So, for example, when I click on Project1, a text box on the form will show
the start date for that project.
I was thinking I could store a struct in the Tag property of each root node
and on NodeMouseClick, throw that structure at a method that updates the
controls of the form.
This means that when the form first opens, as I am creating the node array
for the TreeView from the DataSet, I need to stuff structs in the Tag of
each root node.
Is this utter insanity, or sound reasoning?
One potential complication is a popup form that is supposed to display
further details of the selected project. How would I get the data for that
popup form? Can I store that same struct in some property on the main form
and pass it to the constructor of the popup form when the OpenPopupForm
button is clicked?
Any suggestions welcome...