Click here to Skip to main content
15,902,189 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: silverlight web site performance Pin
Abhinav S20-Nov-11 2:21
Abhinav S20-Nov-11 2:21 
AnswerRe: silverlight web site performance Pin
Mark Salsbery20-Nov-11 8:07
Mark Salsbery20-Nov-11 8:07 
SuggestionRe: silverlight web site performance Pin
delibey21-Nov-11 4:09
delibey21-Nov-11 4:09 
GeneralRe: silverlight web site performance Pin
Pete O'Hanlon21-Nov-11 4:12
mvePete O'Hanlon21-Nov-11 4:12 
GeneralRe: silverlight web site performance Pin
Mark Salsbery21-Nov-11 4:51
Mark Salsbery21-Nov-11 4:51 
QuestionWPF MVVM DataGrid Cell Changed Pin
Kevin Marois19-Nov-11 9:29
professionalKevin Marois19-Nov-11 9:29 
AnswerRe: WPF MVVM DataGrid Cell Changed Pin
Pete O'Hanlon19-Nov-11 10:58
mvePete O'Hanlon19-Nov-11 10:58 
QuestionWPF Nested Treeviews Pin
Kevin Marois19-Nov-11 8:19
professionalKevin Marois19-Nov-11 8:19 
I have 3 collections of data that needs to be displayed in a treeview, so I'm trying to nest them. So far my XAML looks like this:

<UserControl.Resources>

    <HierarchicalDataTemplate DataType="{x:Type models:ProductModel}"
								ItemsSource="{Binding Categories}">
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="{Binding ProductNumber}"></TextBlock>
        </StackPanel>
    </HierarchicalDataTemplate>
    <HierarchicalDataTemplate DataType="{x:Type models:CategoryModel}"
                                ItemsSource="{Binding Parts}">
        <StackPanel Orientation="Horizontal"
                    Margin="0,3,0,3">
            <TextBlock Text="{Binding Caption}"></TextBlock>
        </StackPanel>
    </HierarchicalDataTemplate>
    <DataTemplate DataType="{x:Type models:PartModel}">
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="{Binding PartNumber}"></TextBlock>
            <TextBlock Text="-"
                        Margin="3,0,3,0"/>
            <TextBlock Text="{Binding PartDescription}"></TextBlock>
        </StackPanel>
    </DataTemplate>
</UserControl.Resources>


and then

<TreeView x:Name="tvwParent"
            ScrollViewer.HorizontalScrollBarVisibility="Auto"
            ScrollViewer.VerticalScrollBarVisibility="Auto"
            BorderThickness="0"
            Grid.Row="5"
            Grid.Column="1"
            Margin="5">

    <TreeViewItem Header="Products">
        <DataTemplate>
            <TreeView x:Name="tvwSelections"
                ScrollViewer.HorizontalScrollBarVisibility="Auto"
                ScrollViewer.VerticalScrollBarVisibility="Auto"
                BorderThickness="0"
                ItemsSource="{Binding Products}"/>
        </DataTemplate>
        </TreeViewItem>
            
</TreeView>


When I run it I see the Products node, but it only has one child node showing as "System.Windows.DataTemplate".

I know the templates are correct, I just cant figure out why they are not being applied to the inner tree.

Anyone see what's wrong?

[MODIFIED]
I figured it out. I removed the DataTemplate and it works perfect.
Everything makes sense in someone's mind

QuestionHow to add Scrollviewer inside Dragdockpanel? Pin
Dhivakar.M18-Nov-11 2:04
Dhivakar.M18-Nov-11 2:04 
AnswerRe: How to add Scrollviewer inside Dragdockpanel? Pin
Shmuel Zang19-Nov-11 9:28
Shmuel Zang19-Nov-11 9:28 
QuestionDrag and Drop Listbox in Windows Phone 7.1 Pin
rajeevkuth17-Nov-11 23:25
rajeevkuth17-Nov-11 23:25 
AnswerRe: Drag and Drop Listbox in Windows Phone 7.1 Pin
Loveisasea19-Nov-11 18:22
Loveisasea19-Nov-11 18:22 
GeneralRe: Drag and Drop Listbox in Windows Phone 7.1 Pin
rajeevkuth22-Nov-11 0:36
rajeevkuth22-Nov-11 0:36 
GeneralRe: Drag and Drop Listbox in Windows Phone 7.1 Pin
rajeevkuth23-Nov-11 0:54
rajeevkuth23-Nov-11 0:54 
QuestionOnChange of a model field Pin
Mycroft Holmes17-Nov-11 20:02
professionalMycroft Holmes17-Nov-11 20:02 
AnswerRe: OnChange of a model field Pin
Wayne Gaylard17-Nov-11 20:25
professionalWayne Gaylard17-Nov-11 20:25 
GeneralRe: OnChange of a model field Pin
Mycroft Holmes17-Nov-11 21:00
professionalMycroft Holmes17-Nov-11 21:00 
GeneralRe: OnChange of a model field Pin
Wayne Gaylard17-Nov-11 21:17
professionalWayne Gaylard17-Nov-11 21:17 
GeneralRe: OnChange of a model field Pin
Mycroft Holmes17-Nov-11 21:54
professionalMycroft Holmes17-Nov-11 21:54 
GeneralRe: OnChange of a model field Pin
Wayne Gaylard17-Nov-11 22:01
professionalWayne Gaylard17-Nov-11 22:01 
GeneralRe: OnChange of a model field Pin
Mycroft Holmes18-Nov-11 11:15
professionalMycroft Holmes18-Nov-11 11:15 
GeneralRe: OnChange of a model field Pin
Wayne Gaylard18-Nov-11 17:02
professionalWayne Gaylard18-Nov-11 17:02 
QuestionWell this Lambda expression works Pin
AghaKhan16-Nov-11 13:47
AghaKhan16-Nov-11 13:47 
AnswerRe: Well this Lambda expression works Pin
Abhinav S16-Nov-11 19:51
Abhinav S16-Nov-11 19:51 
QuestionUnable to bind StoryBoard to a label Pin
eli1502197916-Nov-11 10:05
eli1502197916-Nov-11 10:05 

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.