Hi,
I am pretty new to TreeView and ran into a bit of a problem. I am currently populating my treeview from a datareader and it is working fine with the parent and child nodes. My problem is that I need to display the FieldName from the database, but I still need the FieldID value to make changes to the database. So for instance, if a certain node is selected and a button is clicked, I want to be able to know the FieldID - not the FieldName. Currently I can do TreeView1.SelectedNode.Text to get me the FieldName or TreeView1.SelectedNode.FullPath to get me the full path. But this is useless to me since I need to FieldID (primary key field for my database).
I know that with other .net controls there are DisplayMember and ValueMember properties. Is there a way to do this with a treeview.
P.S. - How do you add code snippets into these forums?
I am pretty new to TreeView and ran into a bit of a problem. I am currently populating my treeview from a datareader and it is working fine with the parent and child nodes. My problem is that I need to display the FieldName from the database, but I still need the FieldID value to make changes to the database. So for instance, if a certain node is selected and a button is clicked, I want to be able to know the FieldID - not the FieldName. Currently I can do TreeView1.SelectedNode.Text to get me the FieldName or TreeView1.SelectedNode.FullPath to get me the full path. But this is useless to me since I need to FieldID (primary key field for my database).
I know that with other .net controls there are DisplayMember and ValueMember properties. Is there a way to do this with a treeview.
P.S. - How do you add code snippets into these forums?