I'd like to have the footer cells' content be horizontally centered within the cells. How can this be achieved?
I've tried the following:
And I've tried it both with and without a custom footer style:
Moreover, I've tweaked the various Horizontal[Content]Alignment properties. But so far my fiddling hasn't yielded the desired behavior.
I appreciate the help. Thanks!
I've tried the following:
<telerik:GridViewDataColumn DataMemberBinding="{Binding HubAssemblyNumber}" FooterCellStyle="{StaticResource GridViewFooterCellStyle1}"> <telerik:GridViewDataColumn.Header> <TextBlock Style="{StaticResource centeredHeaderTextBoxStyle}"> <TextBlock.Inlines> <Run>Assembly</Run> <LineBreak /> <Run>Number</Run> </TextBlock.Inlines> </TextBlock> </telerik:GridViewDataColumn.Header> <telerik:GridViewDataColumn.AggregateFunctions> <telerik:CountFunction Caption="Count: " ResultFormatString="{StaticResource commaFormat}" /> </telerik:GridViewDataColumn.AggregateFunctions> <telerik:GridViewDataColumn.Footer> <telerik:AggregateResultsList ItemsSource="{Binding}" HorizontalAlignment="Center" HorizontalContentAlignment="Center" > <ItemsControl.ItemTemplate> <DataTemplate> <TextBlock HorizontalAlignment="Center" Text="{Binding FormattedValue}" /> </DataTemplate> </ItemsControl.ItemTemplate> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Grid HorizontalAlignment="Center" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </telerik:AggregateResultsList> </telerik:GridViewDataColumn.Footer> </telerik:GridViewDataColumn>
And I've tried it both with and without a custom footer style:
<Style x:Key="GridViewFooterCellStyle1" TargetType="{x:Type telerik:GridViewFooterCell}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type telerik:GridViewFooterCell}"> <Border x:Name="PART_FooterCellBorder" <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" /> </Border> </ControlTemplate> </Setter.Value> </Setter> <Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="HorizontalAlignment" Value="Stretch" /> </Style>
Moreover, I've tweaked the various Horizontal[Content]Alignment properties. But so far my fiddling hasn't yielded the desired behavior.
I appreciate the help. Thanks!