This is a migrated thread and some comments may be shown as answers.

Hierarchy Binding

2 Answers 82 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Josh King
Top achievements
Rank 2
Josh King asked on 08 Dec 2010, 05:03 AM
I'm binding to an object that has a list List<> property of a child object.  Within my RadFluidContentControl.LargeContent I'm displaying information from the parent object, but cannot get the child object data to display.  I'd like to display the child data in a ListBox.  

Here's my ListBox code:

<telerik:ListBox Background="WhiteSmoke"  Grid.Row="12" Grid.Column="0" ItemsSource="{Binding}">
                                                <telerik:ListBox.ItemTemplate>
                                                    <telerik:HierarchicalDataTemplate ItemsSource="{Binding AnalysisFiles}">
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Text="{Binding FileName}"></TextBlock>
                                                        </StackPanel>
                                                    </telerik:HierarchicalDataTemplate>
                                                    </telerik:ListBox.ItemTemplate>
                                                </telerik:ListBox>


The property which contains the child items is called AnalysisFiles.  I just need to know how to bind my objects child items.  The ListBox is blank, so my xaml is not working.

Thanks!



<telerik:ListBox Background="WhiteSmoke"  Grid.Row="12" Grid.Column="0" ItemsSource="{Binding}">
                                                <telerik:ListBox.ItemTemplate>
                                                    <telerik:HierarchicalDataTemplate ItemsSource="{Binding AnalysisFiles}"> 
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Text="{Binding FileName}"></TextBlock>
                                                        </StackPanel>
                                                    </telerik:HierarchicalDataTemplate>
                                                    </telerik:ListBox.ItemTemplate>
                                                </telerik:ListBox>
<telerik:ListBox Background="WhiteSmoke"  Grid.Row="12" Grid.Column="0" ItemsSource="{Binding}">
                                                <telerik:ListBox.ItemTemplate>
                                                    <telerik:HierarchicalDataTemplate ItemsSource="{Binding AnalysisFiles}"> 
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Text="{Binding FileName}"></TextBlock>
                                                        </StackPanel>
                                                    </telerik:HierarchicalDataTemplate>
                                                    </telerik:ListBox.ItemTemplate>
                                                </telerik:ListBox>
<telerik:ListBox Background="WhiteSmoke"  Grid.Row="12" Grid.Column="0" ItemsSource="{Binding}">
                                                <telerik:ListBox.ItemTemplate>
                                                    <telerik:HierarchicalDataTemplate ItemsSource="{Binding AnalysisFiles}"> 
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Text="{Binding FileName}"></TextBlock>
                                                        </StackPanel>
                                                    </telerik:HierarchicalDataTemplate>
                                                    </telerik:ListBox.ItemTemplate>
                                                </telerik:ListBox>
<telerik:ListBox Background="WhiteSmoke"  Grid.Row="12" Grid.Column="0" ItemsSource="{Binding}">
                                                <telerik:ListBox.ItemTemplate>
                                                    <telerik:HierarchicalDataTemplate ItemsSource="{Binding AnalysisFiles}"> 
                                                        <StackPanel Orientation="Horizontal">
                                                            <TextBlock Text="{Binding FileName}"></TextBlock>
                                                        </StackPanel>
                                                    </telerik:HierarchicalDataTemplate>
                                                    </telerik:ListBox.ItemTemplate>
                                                </telerik:ListBox>

2 Answers, 1 is accepted

Sort by
0
Josh King
Top achievements
Rank 2
answered on 08 Dec 2010, 08:32 PM
Any takers on this one?  I haven't found a solution yet.  

Thanks
0
Josh King
Top achievements
Rank 2
answered on 09 Dec 2010, 12:00 AM
It was a very dumb thing.  My object did not have read properties set for the List<> object.  Off to the bar to celebrate solving the problem!
Tags
TileView
Asked by
Josh King
Top achievements
Rank 2
Answers by
Josh King
Top achievements
Rank 2
Share this question
or