Styling the .NET MAUI DataPager PageSizes View
The DataPager for .NET MAUI provides a styling mechanism for customizing the look of the view that allows you to navigate to the page sizes by using the PageSizesViewStyle
(Style
with target type of telerik:DataPagerPageSizesView
) property.
The telerik:PageSizesViewStyle
uses as a target type the telerik:DataPagerPageSizesView
. The DataPagerPageSizesView
exposes the following properties:
-
DataPager
(RadDataPager
)—Specifies the associatedTelerik.Maui.Controls.RadDataPager
. -
LabelStyle
(Style
with target typeLabel
)—Specifies the style which applies to the label. -
ComboBoxStyle
(Style
with target typeRadComboBox
)—Specifies the associatedTelerik.Maui.Controls.RadDataPager
. -
BackgroundColor
(Color
)—Specifies the background color of the page sizes view.
Here is an example demonstrating how to use PageSizesViewStyle
.
1. Define the DataPager in XAML:
<telerik:RadDataPager PageSizesViewStyle="{StaticResource PageSizesViewStyle}"
2. Set the styles to the page's resources:
<Style x:Key="ComboStyle" TargetType="telerik:RadComboBox">
</Style>
<Style x:Key="LabelStyle" TargetType="Label">
</Style>
<Style x:Key="PageSizesViewStyle" TargetType="telerik:DataPagerPageSizesView">
<Setter Property="ComboBoxStyle" Value="{StaticResource ComboStyle}" />
<Setter Property="LabelStyle" Value="{StaticResource LabelStyle}" />
</Style>