Hello Richard,
Thank you for the provided code snippet.
The aggregate results in the GridViewFooterCell are displayed by an AggregateResultsList element. When there aren't any items in the ItemsSource of the RadGridView the aggregate results are empty.
One approach that comes to mind for achieving the desired behavior is to update the ControlTemplate of the GridViewFooterCell. Here is what I have in mind:
<ControlTemplate x:Key="GridViewFooterCellTemplate" TargetType="telerik:GridViewFooterCell">
<Border x:Name="PART_FooterCellBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid>
<TextBlock x:Name="emptyContent"
IsHitTestVisible="False"
Margin="{TemplateBinding Padding}"
Text="0"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Visibility="Collapsed"/>
<ContentPresenter
Margin="{TemplateBinding Padding}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding Count}" Value="0">
<Setter TargetName="emptyContent" Property="Visibility" Value="Visible" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style TargetType="telerik:GridViewFooterCell">
<Setter Property="Template" Value="{StaticResource GridViewFooterCellTemplate}"/>
</Style>
With this approach an element is conditionally shown only when the aggregate results are empty. Note, that the Count binding in the DataTrigger refers to the Count property of the DataContext inside the GridViewFooterCell and this approach will work for other aggregate functions as well (not only the CountFunction). Also, note that if you are using the NoXaml dlls, you have to base the style on the default one for the theme.
Do give this a try and let me know, if it helps.
Regards,
Vladimir Stoyanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.