Shobika Palani
Shobika Palani

Reputation: 21

Does ContentPresenter.ContentTemplate supports HierarchicalDataTemplate(WPF)?

I have gone through the HierarchicalDataTemplate in the document, in which it is mentioned that "DataTemplate that supports HeaderedItemsControl". From this point, I understood that HierarchicalDataTemplate is supported for the control which is derived from HeaderedItemsControl (That is to display collection of items). Right?

Now, I just want to confirm that, is there any possible way to load HierarchicalDataTemplate as ContentPresenter.ContentTemplate(WPF) and display items in hierarchical way?

As like below code snippet

<ContentPresenter>
    <ContentPresenter.ContentTemplate>
        <HierarchicalDataTemplate>
            ..........
            ..........
            ..........
        </HierarchicalDataTemplate>
    </ContentPresenter.ContentTemplate>
</ContentPresenter>

Upvotes: 0

Views: 85

Answers (0)

Related Questions