Can you make a treeview behave like a tabcontrol?
-
I have an application where I would like a treeview to behave like a tabcontrol. What I mean is that when the user clicks on a item in the treeview, to the right would appear something sort of like what you might see in Outlook. I am trying to avoid a tabcontrol simply because there will be lot's of tabs and the items have a hierarchy to them. For example There will be companies with adresses. Each company could have multiple addresses and I would like to have a treeview item of "addresses" and then each address will have a nickname like "main address" or "billing address" and I would like for the user to be able to click on this and then see it to the right. I was thinking of maybe using multiple grids and then showing and hiding but seems that that's not in the spirit of wpf and I don't know if it will even work.
-
I have an application where I would like a treeview to behave like a tabcontrol. What I mean is that when the user clicks on a item in the treeview, to the right would appear something sort of like what you might see in Outlook. I am trying to avoid a tabcontrol simply because there will be lot's of tabs and the items have a hierarchy to them. For example There will be companies with adresses. Each company could have multiple addresses and I would like to have a treeview item of "addresses" and then each address will have a nickname like "main address" or "billing address" and I would like for the user to be able to click on this and then see it to the right. I was thinking of maybe using multiple grids and then showing and hiding but seems that that's not in the spirit of wpf and I don't know if it will even work.
I do something like this in one of my applications... There are several ways to go about this, but I do mine with a DataTemplateSelector. Basically, my content pane is just a ContentControl (Actually, I think I'm using a Label, but I forget why), with its content bound to the selected item in the tree. The DataTemplateSelector looks at the data object being displayed, and chooses which DataTemplate to use to display it (I have one for each type of item in the tree). The individual DataTemplates are just resources with standard names, so the selector code is just returning
FindResource("DT_Something") as DataTemplate
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)