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 8437139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:21:11+00:00 2026-06-10T07:21:11+00:00

I am using a class as follows: Class DirectoryViewItem Property Namee As String Property

  • 0

I am using a class as follows:

Class DirectoryViewItem
    Property Namee As String
    Property Iconn As BitmapImage
    Property Path As String
    Property SubNodes As New List(Of DirectoryViewItem)
End Class

and the xaml I used is:

<TreeView Name="DirectoryTreeView"
          TreeViewItem.Expanded="DirectoryTreeView_Expanded"
          Grid.Row="0">
    <TreeView.ItemTemplate >
        <HierarchicalDataTemplate ItemsSource="{Binding SubNodes}">
            <StackPanel Orientation="Horizontal">
                <Image Source="{Binding Iconn}"
                       Width="32" Height="32"
                       VerticalAlignment="Center" HorizontalAlignment="Left" />
                <TextBlock Text="{Binding Namee}"
                           VerticalAlignment="Center" HorizontalAlignment="Left" />
            </StackPanel>
        </HierarchicalDataTemplate>
    </TreeView.ItemTemplate>
</TreeView>

The code is working fine, now I want to expand the 3 or some x node through code, and I found the solution to use something like this:

CType(DirectoryTreeView.Items(3), TreeViewItem).ExpandSubtree()

I found that the CType here is not TreeViewItem but it is my DirectoryViewItem type, … how can this be done?

  • 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-06-10T07:21:13+00:00Added an answer on June 10, 2026 at 7:21 am
    1. Use the TreeView.ItemContainerStyle to bind IsExpanded to a property on your items.
    2. Implement ExpandSubtree on your items (all it needs to do is set that bound property on your items to true recursively).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the as3 loader class as follows: var l:Loader = new Loader(); l.addEventListener(Event.COMPLETE,
I am binding a treeview using a Hierarchical class structure as follows. Store ->ImagePath
I'm getting a Type using Assembly class as follows: var asm = Assembly.GetAssembly(typeof(MyAssembly)); var
I have got the list of Class Name as Follows: Type[] typelist = typeof(Sample.Students).Assembly.GetTypes();
I'm using a Django admin StackedInline, as follows: class BookInline(admin.StackedInline): model = Book.subject.through verbose_name
I'm using ASP.NET MVC 3. I've wriiten a helper class as follows: public static
If I have a class as follows class Log { int rev; String auth;
When I add an HTTP handler: <add verb=* path=*test.aspx type=Handler/> With the class: using
I have a list in the controller as follows: public class TruckData { public
I am using friendly_id as follows: class Page < ActiveRecord::Base extend FriendlyId friendly_id :title,

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.