New to Telerik UI for WPFStart a free 30-day trial

Show the Total Count of Items in RadDataPager.

Updated on Sep 15, 2025

Environment

Product Version2022.3.912
ProductRadDataPager for WPF

Description

How to show the total count of all items in the RadDataPager control in a RadGridView scenario.

Solution

  1. Subscribe to the Loaded event of the RadDataPager control and retrieve the first Grid panel using the ChildrenOfType extension method.

  2. Add a new ColumnDefinition with Width set to Auto, to the ColumnDefinitions property if the retrieved Grid panel.

  3. Move the last child element of the Grid panel to the newly added ColumnDefinition using the Grid.SetColumn method.

  4. Create a new element to display the total count of the entries and bind it to the TotalItemCount property of the ItemsSource property of RadGridView instance.

  5. Set the newly added element to the second column via the Grid.SetColumn method and add it to the Children collection of the Grid panel.

Sample implementation

C#
    private void RadDataPager_Loaded(object sender, RoutedEventArgs e)
    {
        RadDataPager radDataPager = (RadDataPager)sender;

        //Retrieve the Grid panel
        Grid gridPanel = radDataPager.ChildrenOfType<Grid>().FirstOrDefault();

        if (gridPanel != null)
        {
            //Include an additional ColumnDefinition to the ColumnDefinitions of the Grid panel and set its     Width to Auto
            gridPanel.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(0, GridUnitType.    Auto) });
            //Change the Grid.Column attached property for the element that holds the current page  information
            Grid.SetColumn(gridPanel.Children[1], 2);

            //A StackPanel that will hold the total entries information (Different panel can be used if     needed)
            StackPanel totalInfoPanel = new StackPanel()
            {
                Orientation = Orientation.Horizontal,
                HorizontalAlignment = HorizontalAlignment.Right,
                VerticalAlignment = VerticalAlignment.Center,
            };

            Grid.SetColumn(totalInfoPanel, 1);

            TextBlock text = new TextBlock() { Text = "Total entries:", Margin = new Thickness(0, 0, 3, 0) };
            TextBlock totalText = new TextBlock();

            //Bind the ItemsSource.TotalItemCount property of the RadGridView instance to the Text property     of the created TextBlock
            BindingOperations.SetBinding(totalText, TextBlock.TextProperty, new Binding("ItemsSource.   TotalItemCount") { ElementName = "gridView" });

            totalInfoPanel.Children.Add(text);
            totalInfoPanel.Children.Add(totalText);

            //Add the created StackPanel to the Grid panel
            gridPanel.Children.Add(totalInfoPanel);
        }
    }

RadDataPager displaying the total items count

WPF RadDataPager Displaying the Total Items Count

In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support