Click here to Skip to main content
16,004,110 members
Home / Discussions / WPF
   

WPF

 
QuestionOnApplyTemplate & designer mode Pin
SledgeHammer0110-Aug-11 6:50
SledgeHammer0110-Aug-11 6:50 
AnswerRe: OnApplyTemplate & designer mode Pin
SledgeHammer0110-Aug-11 6:55
SledgeHammer0110-Aug-11 6:55 
AnswerRe: OnApplyTemplate & designer mode Pin
Pete O'Hanlon10-Aug-11 7:06
mvePete O'Hanlon10-Aug-11 7:06 
GeneralRe: OnApplyTemplate & designer mode Pin
SledgeHammer0110-Aug-11 7:17
SledgeHammer0110-Aug-11 7:17 
QuestionChanging domain host for silverlight and WCF Pin
Anele Ngqandu10-Aug-11 4:28
Anele Ngqandu10-Aug-11 4:28 
QuestionDispatcher.BeginInvoke getting wrong properties Pin
_Madmatt10-Aug-11 1:05
_Madmatt10-Aug-11 1:05 
QuestionWPF event manager Pin
columbos149279-Aug-11 21:00
columbos149279-Aug-11 21:00 
AnswerRe: WPF event manager Pin
Simon Bang Terkildsen9-Aug-11 22:31
Simon Bang Terkildsen9-Aug-11 22:31 
AnswerRe: WPF event manager Pin
Pete O'Hanlon9-Aug-11 22:40
mvePete O'Hanlon9-Aug-11 22:40 
QuestionDirectory.GetAccessControl Fails in XBAP web client Pin
pal2ashish9-Aug-11 20:21
pal2ashish9-Aug-11 20:21 
QuestionSo, is binding to private / internal properties allowed or not? Pin
SledgeHammer019-Aug-11 6:31
SledgeHammer019-Aug-11 6:31 
AnswerRe: So, is binding to private / internal properties allowed or not? Pin
Mycroft Holmes9-Aug-11 13:09
professionalMycroft Holmes9-Aug-11 13:09 
GeneralRe: So, is binding to private / internal properties allowed or not? Pin
SledgeHammer019-Aug-11 14:03
SledgeHammer019-Aug-11 14:03 
JokeRe: So, is binding to private / internal properties allowed or not? Pin
Mycroft Holmes9-Aug-11 14:19
professionalMycroft Holmes9-Aug-11 14:19 
QuestionRich text Box Content into Outlook mail Pin
Narender Singh Thakur8-Aug-11 4:27
Narender Singh Thakur8-Aug-11 4:27 
AnswerRe: Rich text Box Content into Outlook mail Pin
Pete O'Hanlon8-Aug-11 4:45
mvePete O'Hanlon8-Aug-11 4:45 
GeneralRe: Rich text Box Content into Outlook mail Pin
Narender Singh Thakur8-Aug-11 5:13
Narender Singh Thakur8-Aug-11 5:13 
GeneralRe: Rich text Box Content into Outlook mail Pin
Pete O'Hanlon8-Aug-11 5:22
mvePete O'Hanlon8-Aug-11 5:22 
GeneralRe: Rich text Box Content into Outlook mail Pin
Narender Singh Thakur8-Aug-11 5:24
Narender Singh Thakur8-Aug-11 5:24 
QuestionUpdate TreeView's ItemsSource during runtime Pin
Mc_Topaz8-Aug-11 4:05
Mc_Topaz8-Aug-11 4:05 
I want to update the display of a TreeView during runtime with new data. All data is stored in a collection which is assigned to the TreeView's ItemsSource.
This works fine first time when the TreeView is empty. But second time it doesn't.

C#
// Update ItemsSource first time
tvTree.ItemsSource = root.Branches; // Works

Later after stored more data in the collection root.Branches
C#
// Update ItemsSource second time
tvTree.ItemsSource = root.Branches; // Works



My XAML code:
XAML
<Window x:Class="Tree.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:node="clr-namespace:Tree.TreeNodes"
        Title="MainWindow" Height="350" Width="525">
    
    <Grid>
        <TreeView Name="tvTree" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,5,0,0" Width="400" Height="500">
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Branches}"  DataType="{x:Type node:Node}">
                    <Grid>
                        <TextBlock Text="{Binding Header}" />
                    </Grid>
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
        </TreeView>
    </Grid>
</Window>


The "node" namespace reference, "Branches" in ItemsSource and "Header" in the TextBlock refers to the collection where the data is stored. I guess it's right because the TreeView populates data first time.

Any suggestions?
AnswerRe: Update TreeView's ItemsSource during runtime Pin
Pete O'Hanlon8-Aug-11 4:26
mvePete O'Hanlon8-Aug-11 4:26 
GeneralRe: Update TreeView's ItemsSource during runtime Pin
Mc_Topaz8-Aug-11 5:02
Mc_Topaz8-Aug-11 5:02 
GeneralRe: Update TreeView's ItemsSource during runtime [modified] Pin
SledgeHammer018-Aug-11 6:17
SledgeHammer018-Aug-11 6:17 
GeneralRe: Update TreeView's ItemsSource during runtime Pin
Mc_Topaz8-Aug-11 21:54
Mc_Topaz8-Aug-11 21:54 
Questioncolumns are empty Pin
picasso26-Aug-11 11:18
picasso26-Aug-11 11:18 

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.