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

Footer ChildrenOfType<TextBlock>

1 Answer 36 Views
GridView
This is a migrated thread and some comments may be shown as answers.
John Morris
Top achievements
Rank 1
John Morris asked on 12 Jun 2010, 09:50 PM
I just realized Q1 2010 seems to have changed the behavior of my code.  I used to be able to find a textblock inside my footer using ChildrenOfType<TextBlock> and changing the value.

My footer xaml is
<telerikGridView:GridViewDataColumn.Footer > 
                                            <Telerik_Windows_Controls_GridView:AggregateResultsList ItemsSource="{Binding}" HorizontalAlignment="Right" VerticalAlignment="Center">  
                                                <Telerik_Windows_Controls_GridView:AggregateResultsList.ItemTemplate> 
                                                    <DataTemplate> 
                                                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Height="40">  
                                                            <TextBlock VerticalAlignment="Center" TextAlignment="Right" FontSize="11" x:Name="txtJanFtr" FontWeight="Bold" Text="{Binding FormattedValue}" />                                                 
                                                        </StackPanel> 
                                                    </DataTemplate> 
                                                </Telerik_Windows_Controls_GridView:AggregateResultsList.ItemTemplate> 
                                                <Telerik_Windows_Controls_GridView:AggregateResultsList.ItemsPanel> 
                                                    <ItemsPanelTemplate> 
                                                        <StackPanel Orientation="Vertical" /> 
                                                    </ItemsPanelTemplate> 
                                                </Telerik_Windows_Controls_GridView:AggregateResultsList.ItemsPanel> 
                                            </Telerik_Windows_Controls_GridView:AggregateResultsList> 
                                        </telerikGridView:GridViewDataColumn.Footer>                   

I used to be able to access txtJanFtr like so

grdCapBonds.ChildrenOfType<TextBlock>().Where(v => v.Name == "txtJanFtr").FirstOrDefault() 

How should I obtain a reference to a TextBlock inside the footer?

Thank you.

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 15 Jun 2010, 08:43 AM
Hello John Morris,

The way you are obtaining a reference to the TextBlock is quite right. I have tested it with our latest version and everything works as expected. So, please give us more details about your scenario and requirements so that I can provide you with a possible solution.

Sincerely yours,
Maya
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
John Morris
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or