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

  • Home
  • SEARCH
  • 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 6333929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:33:39+00:00 2026-05-24T18:33:39+00:00

I have a project in which I load data from a file and need

  • 0

I have a project in which I load data from a file and need to convert the data into a treeviewitem with multiple subitems.

I know that I could programatically added these sub items to a root node using a loop however I feel like there is a most likely a way to use a WPF template and then set the values using that rather than creating and adding many different objects in my code.

  • 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-24T18:33:40+00:00Added an answer on May 24, 2026 at 6:33 pm

    To avoid creating the TreeView in code-behind, you would need to bind to a ItemsSource through a HierarchicalDataTemplate.

    There are two kinds of data providers built into XAML. The first is an ObjectDataProvider which is something like an ObservableCollection. The second is an XmlDataProvider.

    If your file format is XML you can take advantage of the XmlDataProvider and not have to parse your file. If not, you would need to parse your file into something like an ObservableCollection and then use that as the HierarchicalDataTemplate ItemsSource.

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

Sidebar

Related Questions

In my project i need to load aml data from internet and after that
With a PHP MVC project, I have a few model classes that load data
I have file.txt data file in my project which is in resource folder. Now
So in Code::Blocks in Ubuntu (latest). I have a project in which I load
I have a project which contains different components that everyone works on. We have
I have a project which builds correctly from the command line. On one of
I have Django project on Dreamhost server which has several views that returns Json
Possible Duplicate: Calling ActionScript 3 function from C# i have a project which is
I have a project which is source controlled using Subversion and VisualSVN. Since the
I have a project which it's domain contain following classes: Courier Customer Food Order

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.