Click here to Skip to main content
15,916,941 members
Home / Discussions / WPF
   

WPF

 
QuestionRe: How to Customize SDK:Tab Control Pin
Mark Salsbery21-Nov-11 5:02
Mark Salsbery21-Nov-11 5:02 
QuestionRetrieving icons associated with installed Printers for use in C# and WPF Pin
Alisaunder20-Nov-11 12:55
Alisaunder20-Nov-11 12:55 
AnswerRe: Retrieving icons associated with installed Printers for use in C# and WPF Pin
SledgeHammer0120-Nov-11 17:32
SledgeHammer0120-Nov-11 17:32 
GeneralRe: Retrieving icons associated with installed Printers for use in C# and WPF Pin
Alisaunder20-Nov-11 18:24
Alisaunder20-Nov-11 18:24 
AnswerRe: Retrieving icons associated with installed Printers for use in C# and WPF Pin
Wayne Gaylard20-Nov-11 18:49
professionalWayne Gaylard20-Nov-11 18:49 
GeneralRe: Retrieving icons associated with installed Printers for use in C# and WPF Pin
Alisaunder21-Nov-11 5:15
Alisaunder21-Nov-11 5:15 
GeneralRe: Retrieving icons associated with installed Printers for use in C# and WPF Pin
SledgeHammer0121-Nov-11 6:18
SledgeHammer0121-Nov-11 6:18 
QuestionRotating 3d cylinder to a specific direction (Vector3d) Pin
ekoman20-Nov-11 1:17
ekoman20-Nov-11 1:17 
AnswerRe: Rotating 3d cylinder to a specific direction (Vector3d) Pin
ekoman20-Nov-11 4:05
ekoman20-Nov-11 4:05 
QuestionHow to remove the border when mouse enter a listboxitem Pin
Loveisasea19-Nov-11 17:41
Loveisasea19-Nov-11 17:41 
AnswerRe: How to remove the border when mouse enter a listboxitem Pin
Abhinav S20-Nov-11 2:38
Abhinav S20-Nov-11 2:38 
AnswerRe: How to remove the border when mouse enter a listboxitem Pin
Mark Salsbery20-Nov-11 8:04
Mark Salsbery20-Nov-11 8:04 
Questionsilverlight web site performance Pin
delibey19-Nov-11 14:17
delibey19-Nov-11 14:17 
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 

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.