Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6650677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:55:16+00:00 2026-05-26T00:55:16+00:00

Edit 2 : This is what i want to do with only 1 treeview

  • 0

Edit 2 :

This is what i want to do with only 1 treeview :

my treeview with outlook style http://img204.imageshack.us/img204/8218/sansreju.jpg

Edit :

I want to know how make a treeview with different expander styles in terms of the level. I currently use nested expanders.

Original question :

I am trying to get a WPF Treeview that has differents expanders styles in terms of the level.

What i actually have is that :

a listview wich contains differents templates in term of the ojbect type by using a selector

<ListView Name="MyTreeView" ItemTemplateSelector="{StaticResource Selector}">

<!-- Items Template -->
<HierarchicalDataTemplate x:Key="ItemsTemplate" ItemsSource="{Binding Childrens}">
    <TextBlock Text="{Binding Name}" Margin="5,0" VerticalAlignment="Center"/>
</HierarchicalDataTemplate>

<!-- SubNode Template -->
<DataTemplate x:Key="SubNodeTemplate">
    <Expander Style="{StaticResource SubExpander}">
        <TreeView ItemsSource="{Binding Childrens}"
                  ItemTemplateSelector="{StaticResource Selector}"/>
    </Expander>
</DataTemplate>

<!-- Node Template -->
<DataTemplate x:Key="NodeTemplate">
    <Expander Style="{StaticResource MainViewExpander}">
        <ListView ItemsSource="{Binding Childrens}"
                  ItemTemplateSelector="{StaticResource Selector}"/>
    </Expander>
</DataTemplate>

And this is the code behind with object used for mapping :
I got a list (of IUpSlideItem ) and apply it to MyTreeview.ItemsSource

Public Interface IUpSlideItem
    Property Childrens As List(Of IUpSlideItem)
    Property Name As String
End Interface

Public Class Item
    Implements IUpSlideItem

    Public Property Childrens As System.Collections.Generic.List(Of IUpSlideItem) Implements IUpSlideItem.Childrens
    Public Property Name As String Implements IUpSlideItem.Name

End Class

Public Class Node
    Implements IUpSlideItem

    Public Property Childrens As System.Collections.Generic.List(Of IUpSlideItem) Implements IUpSlideItem.Childrens
    Public Property Name As String Implements IUpSlideItem.Name

End Class

Now the question is to know if only 1 treeview with different expander style in terms of the type’s item is possible. I need this because i want single item select only.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:55:16+00:00Added an answer on May 26, 2026 at 12:55 am

    by using an item container style selctor you can have 1 treeview with different expander style :
    http://msdn.microsoft.com/fr-fr/library/system.windows.hierarchicaldatatemplate.itemcontainerstyleselector%28v=vs.90%29.aspx

    edit : this solution is working, i have a perfect TreeView now

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a Cake PHP novice. I want to edit the table Issue. This
I have a treeview with nodes like this: Foo (1234), and want to allow
I have one table with 20 columns, I want only display this data on
i want to make this code for pages add_action( 'add_meta_boxes', 'meta_box_video' ); function meta_box_video()
Edit: This question was written in 2008, which was like 3 internet ages ago.
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
EDIT: This question is more about language engineering than C++ itself. I used C++
Edit: This was accidentally posted twice. Original: VB.NET Importing Classes I've seen some code
EDIT : This question duplicates How to access the current Subversion build number? (Thanks
Edit: This code is fine. I found a logic bug somewhere that doesn't exist

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.