Click here to Skip to main content
15,901,373 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Property value updation not displayed Pin
Pete O'Hanlon20-Oct-08 0:43
mvePete O'Hanlon20-Oct-08 0:43 
Questioncould any one help in how to create seprate dlls in wpf project? Pin
dwarakk19-Oct-08 0:47
dwarakk19-Oct-08 0:47 
AnswerRe: could any one help in how to create seprate dlls in wpf project? Pin
Jammer19-Oct-08 2:39
Jammer19-Oct-08 2:39 
AnswerRe: could any one help in how to create seprate dlls in wpf project? Pin
User 27100919-Oct-08 4:58
User 27100919-Oct-08 4:58 
QuestionXAML Power Toys 3.4 Released Pin
User 27100918-Oct-08 20:25
User 27100918-Oct-08 20:25 
AnswerRe: XAML Power Toys 3.4 Released Pin
Michael Sync18-Oct-08 21:39
Michael Sync18-Oct-08 21:39 
GeneralRe: XAML Power Toys 3.4 Released Pin
User 27100919-Oct-08 4:59
User 27100919-Oct-08 4:59 
QuestionHow to bind TreeView with nested object without using HierarchicalDatatemplate Pin
Michael Sync18-Oct-08 5:12
Michael Sync18-Oct-08 5:12 
Hello All,

Is there any way to bind TreeView with nested object without using HierarchicalDatatemplate?

For example:

<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
<TreeView Margin="10,10,46,52" Name="familyTreeView"
/>
</Grid>
</Window>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication1 {
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window {
public Window1() {
InitializeComponent();
List<Person> _family = new List<Person>();
Person mom = new Person() { Name = "Hteik Tin May" };

mom.Children.Add(new Person() { Name = "Michael Sync" });
mom.Children.Add(new Person() { Name = "Shwesin Sync" });
mom.Children.Add(new Person() { Name = "Aye Nyein Thu" });
mom.Children.Add(new Person() { Name = "Kyaw Zin Thu" });


_family.Add(mom);
familyTreeView.ItemsSource = _family;
familyTreeView.DisplayMemberPath = "Name";
}
}

public class Person {
readonly List<Person> _children = new List<Person>();
public IList<Person> Children {
get {
return _children;
}
}
public string Name { get; set; }
}
}


It's not working without HierarchicalDatatemplate.

Any idea?

Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)


AnswerRe: How to bind TreeView with nested object without using HierarchicalDatatemplate Pin
User 27100918-Oct-08 20:11
User 27100918-Oct-08 20:11 
GeneralRe: How to bind TreeView with nested object without using HierarchicalDatatemplate Pin
Michael Sync18-Oct-08 21:37
Michael Sync18-Oct-08 21:37 
GeneralRe: How to bind TreeView with nested object without using HierarchicalDatatemplate Pin
User 27100919-Oct-08 4:55
User 27100919-Oct-08 4:55 
QuestionQuick Question Pin
MrMcIntyre18-Oct-08 1:52
MrMcIntyre18-Oct-08 1:52 
AnswerRe: Quick Question Pin
User 27100918-Oct-08 20:12
User 27100918-Oct-08 20:12 
Questionhelp in xps? Pin
Dotnetkanna17-Oct-08 18:45
Dotnetkanna17-Oct-08 18:45 
AnswerRe: help in xps? Pin
touseef17-Oct-08 20:25
touseef17-Oct-08 20:25 
QuestionOdd WPF Problem Pin
Jammer17-Oct-08 12:57
Jammer17-Oct-08 12:57 
AnswerRe: Odd WPF Problem Pin
User 27100918-Oct-08 20:16
User 27100918-Oct-08 20:16 
GeneralRe: Odd WPF Problem Pin
Jammer19-Oct-08 3:25
Jammer19-Oct-08 3:25 
QuestionWPF ListBoxItem Question Pin
Pedram Behroozi17-Oct-08 10:58
Pedram Behroozi17-Oct-08 10:58 
AnswerRe: WPF ListBoxItem Question Pin
User 27100918-Oct-08 20:19
User 27100918-Oct-08 20:19 
GeneralRe: WPF ListBoxItem Question Pin
Pedram Behroozi19-Oct-08 0:30
Pedram Behroozi19-Oct-08 0:30 
Questionevent notification Pin
vinod.sankuthodi16-Oct-08 23:46
vinod.sankuthodi16-Oct-08 23:46 
AnswerRe: event notification Pin
User 27100918-Oct-08 20:22
User 27100918-Oct-08 20:22 
QuestionUsing Multiple User Controls Pin
jayvee102216-Oct-08 16:14
jayvee102216-Oct-08 16:14 
AnswerRe: Using Multiple User Controls Pin
Pete O'Hanlon16-Oct-08 23:07
mvePete O'Hanlon16-Oct-08 23:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.