Telerik Forums
UI for WPF Forum
0 answers
249 views

I am using TelerikPager with latest version of required nuget package. Setting all required properties like PageSize, Total, ButtonCount, Page, PageChanged. 

On WPF UI, It is showing all pages along with next & previous button but it not showing total page count like "1 - 8 of 24".  Need suggestion or help to resolve this issue.

                <TelerikPager PageSize=""
                              Total=""
                              ButtonCount=""
                              Page=""
                              PageChanged=""
                              ShowInfo="true"></TelerikPager>

Vikas
Top achievements
Rank 1
 asked on 01 Apr 2026
0 answers
92 views

ViewModel.cs:


public QueryableDataServiceCollectionView<MyTable> MyTableView { get; set; }

var dsq = context.MyTable.AddQueryOption("$orderby", "InsertDateTime");
MyTableView = new QueryableDataServiceCollectionView<MyTable>(dsq.Context, dsq)
{
    PageSize = 25,
    AutoLoad = true
};

View.xaml:


<telerik:RadGridView ItemsSource="{Binding ElementName=MyPager, Path=PagedSource}">
    <telerik:RadGridView.Columns>      
        <telerik:GridViewDataColumn Header="Insert Date Time"
                                    DataMemberBinding="{Binding InsertDateTime}" />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

<telerik:RadDataPager x:Name="MyPager"
                      PageSize="25"
                      Source="{Binding MyTableView}" />

When I click on the Insert Date Time column header, a Microsoft.OData.Client.DataServiceQueryException exception is thrown with the message "Duplicate property named 'insertDateTime' is not supported in '$orderby'."

The query that's spat out by the RadGridView/RadDataPager/QueryableDataServiceCollectionView is /odata/v1/MyTable?$orderby=insertDateTime,InsertDateTime&$top=25

How do I fix this?

For context, MyTable has 10 million records with server-side pagination enabled and the records must be sorted by InsertDateTime when first loaded.

Wizard6650
Top achievements
Rank 1
Iron
Iron
 updated question on 23 Apr 2024
0 answers
124 views


  <Style x:Key="CrashPager"
         TargetType="telerik:RadDataPager"
         BasedOn="{StaticResource {x:Type telerik:RadDataPager}}">
      <Setter Property="Margin"
              Value="0,0,0,0" />
      <Setter Property="Padding"
              Value="0,0,0,0" />
      <Setter Property="Height"
              Value="Auto" />
      <Setter Property="VerticalAlignment"
              Value="Top" />
      <Setter Property="VerticalContentAlignment"
              Value="Top" />
  </Style>

 

The code above has no margin and no padding.
Something is chopping the bottom from the RadDataPager control.
My guess is that this is being caused by the theme.
How can I get to show the control correctly?

 

Paul
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 04 Apr 2024
1 answer
240 views

Hello,

 

Here is my situation:

1. I have got client app in WPF ( Cant create here any db context etc )

2. I have got Rest Api where is DbContext (EntityFramework)

3. I have got RadGrid and RadPager

 

I want to pass QueryableCollectionView or QueryableEntityCollectionView or something else? to this rest api, processing data, use filters, pagination and sorters from radgrid. Then in returns i want to receive collection of Products, Employees or something

 

Is any body do something like this? I know that in Blazor UI there is DataSourceRequest etc and it works fine, but i did not find alternative in WPF

Martin Ivanov
Telerik team
 answered on 18 May 2023
1 answer
332 views

Hello.

 

I have the same situation as https://www.telerik.com/forums/virtual-page-count.
Since the database has over 100 million data, I don't want to bring all the data into memory.
When a user clicks on a specific page, I'm trying to get only the data in that range from the DBMS.


I also read about Unbound Mode (https://docs.telerik.com/devtools/wpf/controls/raddatapager/features/unbound-mode)
But this seems to use code-behind.
I don't want to write a code-behind because I use the MVVM pattern.
How can I do it?

 

The code below has been simplified.

 

1. DataView.xaml

<UserControl x:Class="MyProject.Views.MyDataView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:MyProject.Views"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
             mc:Ignorable="d" 
             d:DesignHeight="550" d:DesignWidth="1920">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="26" />
            <RowDefinition Height="400"/>
            <RowDefinition Height="28" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0" HorizontalAlignment="Right">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Page Size" Margin="2 8 12 2"  FontWeight="SemiBold"/>

                <telerik:RadComboBox 
                                 Height="22"
                                 Margin="0 0 10 0"
                                 FontFamily="Segoe UI"
                                 ClearSelectionButtonVisibility="Visible" 
                                 ClearSelectionButtonContent="Show all" 
                                 DisplayMemberPath="DisplaySize" 
                                 ItemsSource="{Binding MyDataPageSize}" 
                                 SelectedItem="{Binding SelectedMyDataPageSize}"
                                 AllowMultipleSelection="False"
                                 Command="{Binding RefreshMyDataCommand}"/>
            </StackPanel>
        </Grid>

        <telerik:RadGridView x:Name="MyDataGridView"
                             Grid.Row="1"
                             IsFilteringAllowed="False"
                             AutoGenerateColumns="False"
                             ShowGroupPanel="False"
                             CanUserFreezeColumns="False"
                             RowIndicatorVisibility="Collapsed"
                             SelectionMode="Extended"
                             TextBlock.TextAlignment="Center"
                             CanUserSortColumns="False"
                             IsReadOnly="True"
                             Margin="10 5 10 0"
                             ScrollMode="RealTime"
                             ItemsSource="{Binding DynamicGridViewItemSource}"
        </telerik:RadGridView>

        <telerik:RadDataPager Grid.Row="2"
				x:Name="MyDataPager"
                              Width="{Binding ElementName=MyDataGridView, Path=ActualWidth}"
							  PageSize="{Binding SelectedMyDataPageSize.Size}"
							  Source="{Binding Items, ElementName=MyDataGridView}"
							  ItemCount="{Binding TotalItemCount}"
                              BorderThickness="1,0,1,1"
							  DisplayMode="All"
                              AutoEllipsisMode="Both"
							  NumericButtonCount="10"
							  IsTotalItemCountFixed="False" >
            <behaviors:Interaction.Triggers>
                <behaviors:EventTrigger EventName="PageIndexChanged">
                    <behaviors:InvokeCommandAction Command="{Binding PageIndexChangedCommand}"
                                           CommandParameter="{Binding ElementName=MyDataPager, Path=PageIndex}" />

                </behaviors:EventTrigger>
            </behaviors:Interaction.Triggers>
        </telerik:RadDataPager>
    </Grid>
</UserControl>

 

2. DataViewModel.cs

namespace MyProject.ViewModels
{
    public class StageDTO
    {
        public string StartNumber { get; set; }
        public string EndNumber { get; set; }
    }

    public class MyDataViewModel : ViewModelBase
    {

// some code

        private int _totalItemCount;
        public int TotalItemCount
        {
            get
            {
                return _totalItemCount;
            }
            set
            {
                _totalItemCount = value;
                OnPropertyChanged(nameof(TotalItemCount));
            }
        }

        public MyDataViewModel(CyclerMode mode)
        {
            // do something
        }

        public void ShowMyDataOfSelectedStage(object parameter)
        {
           StageDTO dto = parameter as StageDTO;
 
            // do something

          // and i calculate TotalItemCount here
                TotalItemCount = Convert.ToInt32(dto.EndNumber) - Convert.ToInt32(dto.StartNumber);
           
        }
    }
}

 

There may have been a typo in the process of simplifying, but there is no problem when i actually run the program.

TotalItemCount = Convert.ToInt32(dto.EndNumber) - Convert.ToInt32(dto.StartNumber);

The data goes in correctly in the code above, but nothing changes.

I made the changes below, but it still doesn't work.

ItemCount="{Binding TotalItemCount, UpdateSourceTrigger=PropertyChanged}"

If I change it like below
ItemCount="{Binding TotalItemCount, Mode=TwoWay}"

I am getting an exception like below.
System.InvalidOperationException: 'Setting RadDataPager.ItemCount is allowed in Unbound Mode only.'

 

How do I get it to work like I want?

Vladimir Stoyanov
Telerik team
 answered on 10 May 2023
1 answer
503 views

How I can do server-side paging/sorting/filtering in a RadDataGrid. I retrieve the data from an azure function and I don't want to retrieve all data from the database. I pass as a parameter to the azure function, the page index, and the page size.  the response returns the result of the LINQ query with Skip(page index) and Take(page Size), and total row count.

Thank you for your help.

Martin Ivanov
Telerik team
 answered on 07 Feb 2022
2 answers
232 views

     Hi,

I've added a DataPager to a DataGrid, and now the DataGrid.IsSynchronizedWithCurrentItem property is not working.  How can I resolve this?  Below is my code...

<DockPanel LastChildFill="True">
    <telerik:RadDataPager x:Name="radDataPager"
    DockPanel.Dock="Bottom"
                          Source="{Binding GridData}"
                          PageSize="100"
                          DisplayMode="All"
                          AutoEllipsisMode="After"
                          NumericButtonCount="5"/>
    <telerik:RadGridView x:Name="radGridView"
                         Margin="0"
                         Width="{Binding ElementName=GridViewGrid, Path=ActualWidth}"
                         EnableColumnVirtualization="True"
                         EnableRowVirtualization="True"
                         AlternateRowBackground="AliceBlue"
                         ItemsSource="{Binding PagedSource, ElementName=radDataPager}"
                         SelectionUnit="FullRow"
                         RowIndicatorVisibility="Collapsed"
                         GridLinesVisibility="None"
                         ScrollMode="Deferred"
                         FilteringMode="Popup"
                         CanUserFreezeColumns="False"
                         AutoGenerateColumns="True"
                         ColumnWidth="Auto"
                         IsSynchronizedWithCurrentItem="True"
                         IsReadOnly="True"
                         IsTabStop="False"
                         ValidatesOnDataErrors="InEditMode"
                         amUI:GridViewEventManager.IsEnabled="True"
                         amUI:LookupTextBoxFilterBehavior.LookupTextBox="{Binding ElementName=LookupTextBox}">
    </telerik:RadGridView>
</DockPanel>

 

Vladimir Stoyanov
Telerik team
 answered on 14 Jan 2021
1 answer
163 views

I am trying to use DataPager on my grid. My goal is to put the pager on the different part of my screen.

For example, I have a window with two main grid. I used a Frame on the first grid to display a page with RadGridView. This Grid is the one I want to have the Pager. But I want to put the Pager on the second Grid of my main window. This is for layout purpose. Is this possible? 

 

Thank you

Martin Ivanov
Telerik team
 answered on 21 Jul 2020
2 answers
227 views

I have an existing WPF application which uses Microsoft.Windows.controls.Datagrid. I want to add the RadDataPager to do the pagination, how can I do it? 

Here's my sample code. It displays the data but it doesn't do the pagination. All data is displayed in a single page.

<dg:DataGrid Name="dgRegistryDetails" FontSize="14" DockPanel.Dock="Bottom" Foreground="#FF07315B"

                         ItemsSource="{Binding}"   CanUserSortColumns="true"
IsReadOnly="True"    AutoGenerateColumns="False" >

 

<telerik:RadDataPager VerticalAlignment="Bottom" DisplayMode="FirstLastPreviousNextNumeric" Source="{Binding Items, ElementName=dgRegistryDetails}"  IsTotalItemCountFixed="True" x:Name="RadPager" PageSize="10" />

Niraja
Top achievements
Rank 1
 answered on 08 Nov 2019
0 answers
134 views

I have the TabControl with any TabPages. Each page has TreeView with with several thousand nodes + DataPager. All TabPages have identical XAML and ViewModel. An exception occurs when I switch between pages (incorrect arguments RadDataPager.PageSize and RadDataPager.PageIndex). If  TreeView on selecting TabPage is empty exeption not occurs.

Fragment my XAML :

...

<telerik:RadDataPager x:Name="xDataPager" Grid.Column="2" Margin="10,0,10,0"
PageSize="{Binding Value, ElementName=ndCount,Mode=TwoWay,UpdateSourceTrigger=Explicit}" FontSize="12"
BorderThickness="1,0,1,1" DisplayMode="All"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
Source="{Binding ObjectList,Mode=TwoWay,NotifyOnSourceUpdated=True,UpdateSourceTrigger=PropertyChanged}"
PageIndex="{Binding ActualPage, Mode=TwoWay, UpdateSourceTrigger=Explicit}"
IsTotalItemCountFixed="false" >
<telerik:EventToCommandBehavior.EventBindings>
<telerik:EventBinding Command="{Binding PageChangedCommand}" EventName="PageIndexChanged" RaiseOnHandledEvents="False" PassEventArgsToCommand="True" />
<telerik:EventBinding Command="{Binding PageChangingCommand}" EventName="PageIndexChanging" RaiseOnHandledEvents="False" PassEventArgsToCommand="True" />
</telerik:EventToCommandBehavior.EventBindings>
</telerik:RadDataPager>
<StackPanel Orientation="Horizontal" Grid.Column="3" VerticalAlignment="Center" Margin="10,0,10,0">
<TextBlock Text="Объектов на странице :" FontSize="12" VerticalAlignment="Center" />
<telerik:RadNumericUpDown x:Name="ndCount" IsInteger="True" ValueFormat="Numeric" Value="{Binding PageSize, Mode=TwoWay,UpdateSourceTrigger=Explicit,NotifyOnValidationError=True}" Minimum="10" Maximum="200" SmallChange="5" LargeChange="10" VerticalAlignment="Center" Margin="5,0,10,0"/>
</StackPanel> <telerik:RadDataPager x:Name="xDataPager" Grid.Column="2" Margin="10,0,10,0"
PageSize="{Binding Value, ElementName=ndCount,Mode=TwoWay,UpdateSourceTrigger=Explicit}" FontSize="12"
BorderThickness="1,0,1,1" DisplayMode="All"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center"
Source="{Binding ObjectList,Mode=TwoWay,NotifyOnSourceUpdated=True,UpdateSourceTrigger=PropertyChanged}"
PageIndex="{Binding ActualPage, Mode=TwoWay, UpdateSourceTrigger=Explicit}"
IsTotalItemCountFixed="false" >
<telerik:EventToCommandBehavior.EventBindings>
<telerik:EventBinding Command="{Binding PageChangedCommand}" EventName="PageIndexChanged" RaiseOnHandledEvents="False" PassEventArgsToCommand="True" />
<telerik:EventBinding Command="{Binding PageChangingCommand}" EventName="PageIndexChanging" RaiseOnHandledEvents="False" PassEventArgsToCommand="True" />
</telerik:EventToCommandBehavior.EventBindings>
</telerik:RadDataPager>
<StackPanel Orientation="Horizontal" Grid.Column="3" VerticalAlignment="Center" Margin="10,0,10,0">
<TextBlock Text="Objects on page:" FontSize="12" VerticalAlignment="Center" />
<telerik:RadNumericUpDown x:Name="ndCount" IsInteger="True" ValueFormat="Numeric" Value="{Binding PageSize, Mode=TwoWay,UpdateSourceTrigger=Explicit,NotifyOnValidationError=True}" Minimum="10" Maximum="200" SmallChange="5" LargeChange="10" VerticalAlignment="Center" Margin="5,0,10,0"/>
</StackPanel>

...

 

Rumyantsev
Top achievements
Rank 1
 asked on 21 Oct 2019
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?