P
pigeonrandle
Hi,
My application creates a project that is structured like a tree, so i
want to use a treeview to display it to the user.
Would it be a good idea to create the various parts of project as
classes inherited from TreeNode and then just add them to the treeview
(ie adding extra properties to the inherited classes to hold my data)?
This would make outputting the project as an xml file very simple as i
could just traverse the treeview and get the nodes to write their part
of the document.
Or is it a better idea to create separate classes to hold my data, and
place them in the .Tag of a normal treenode?
Or is their another way i should do this?
Basically, is mixing the 'data' with the UI a good idea? I thought i
read somewhere that it is a bad idea .
Cheers,
James.
My application creates a project that is structured like a tree, so i
want to use a treeview to display it to the user.
Would it be a good idea to create the various parts of project as
classes inherited from TreeNode and then just add them to the treeview
(ie adding extra properties to the inherited classes to hold my data)?
This would make outputting the project as an xml file very simple as i
could just traverse the treeview and get the nodes to write their part
of the document.
Or is it a better idea to create separate classes to hold my data, and
place them in the .Tag of a normal treenode?
Or is their another way i should do this?
Basically, is mixing the 'data' with the UI a good idea? I thought i
read somewhere that it is a bad idea .
Cheers,
James.