You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blazor/pager/behavior-settings.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
2
layout: post
3
3
title: Behavior Settings in Blazor Pager Component | Syncfusion
4
-
description: Learn how to configure core behavior settings—page size, numeric item count, total item count, and more—in the Syncfusion Blazor Pager component.
4
+
description: Learn how to configure core behavior settingspage size, numeric item count, total item count, and morein the Syncfusion Blazor Pager component.
5
5
platform: Blazor
6
6
control: Pager
7
7
documentation: ug
8
8
---
9
9
10
-
# Behaviour Settings in Pager Component
10
+
# Behavior Settings in Pager Component
11
11
12
12
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor Pager component includes properties that control its rendering behavior, such as numeric items and navigation buttons. The total number of pages is determined by the values of the [PageSize](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.SfPager.html#Syncfusion_Blazor_Navigations_SfPager_PageSize) and [TotalItemsCount](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.SfPager.html#Syncfusion_Blazor_Navigations_SfPager_TotalItemsCount) properties.
| GoToPageAsync | This method navigates the target page by the given number in the argument.|
17
-
| GoToLastPageAsync | This method navigates to the last page of the pager component. |
18
-
| GoToFirstPageAsync | This method navigates to the first page of the pager component. |
19
-
| GoToNextPageAsync | This method navigates to the next page of the pager component. |
20
-
| GoToPreviousPageAsync | This method navigates to the previous page of the pager component. |
21
-
| UpdatePageSizeAsync | This method updates the page size of the Pager. |
22
-
| UpdateNumericItemsCountAsync | This method updates the numeric item count of the Pager. |
23
-
| RefreshAsync | This method applies all the property changes and renders the component again. |
12
+
The Syncfusion<supstyle="font-size:70%">®</sup> Blazor Pager component provides built-in methods for programmatically controlling navigation and updating pager settings. These methods allow external actions such as navigating to specific pages, moving to the first or last page, updating page size, and refreshing the component. Each method can be invoked asynchronously to ensure smooth interaction within Blazor applications.
13
+
14
+
## Navigate to a Specific Page
15
+
16
+
The [GoToPageAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.SfPager.html#Syncfusion_Blazor_Navigations_SfPager_GoToPageAsync_System_Int32_) method navigates to the specified page number.
<SfButton @onclick="NavigateToPage">Go to Page 5</SfButton>
29
+
30
+
@code
31
+
{
32
+
private SfPager? pager;
33
+
34
+
private async Task NavigateToPage()
35
+
{
36
+
await pager?.GoToPageAsync(5);
37
+
}
38
+
}
39
+
```
40
+
41
+
## Navigate to the Last Page
42
+
43
+
The [GoToLastPageAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.SfPager.html#Syncfusion_Blazor_Navigations_SfPager_GoToLastPageAsync) method navigates to the last page of the Pager component.
<SfButton @onclick="NavigateToLastPage">Go to Last Page</SfButton>
51
+
52
+
@code
53
+
{
54
+
55
+
private SfPager? pager;
56
+
57
+
private async Task NavigateToLastPage()
58
+
{
59
+
await pager?.GoToLastPageAsync();
60
+
}
61
+
}
62
+
```
63
+
64
+
## Navigate to the First Page
65
+
66
+
The [GoToFirstPageAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.SfPager.html#Syncfusion_Blazor_Navigations_SfPager_GoToFirstPageAsync) method navigates to the first page of the Pager component.
<SfButton @onclick="NavigateToFirstPage">Go to First Page</SfButton>
74
+
75
+
@code
76
+
{
77
+
78
+
private SfPager? pager;
79
+
80
+
private async Task NavigateToFirstPage()
81
+
{
82
+
await pager?.GoToFirstPageAsync();
83
+
}
84
+
}
85
+
```
86
+
87
+
## Navigate to the Next Page
88
+
89
+
The [GoToNextPageAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.SfPager.html#Syncfusion_Blazor_Navigations_SfPager_GoToNextPageAsync) method navigates to the next page of the Pager component.
<SfButton @onclick="NavigateToNextPage">Go to Next Page</SfButton>
97
+
98
+
@code
99
+
{
100
+
private SfPager? pager;
101
+
102
+
private async Task NavigateToNextPage()
103
+
{
104
+
await pager?.GoToNextPageAsync();
105
+
}
106
+
}
107
+
```
108
+
109
+
## Navigate to the Previous Page
110
+
111
+
The [GoToPreviousPageAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.SfPager.html#Syncfusion_Blazor_Navigations_SfPager_GoToPreviousPageAsync) method navigates to the previous page of the Pager component.
<SfButton @onclick="NavigateToPreviousPage">Go to Previous Page</SfButton>
119
+
120
+
@code
121
+
{
122
+
private SfPager? pager;
123
+
124
+
private async Task NavigateToPreviousPage()
125
+
{
126
+
await pager?.GoToPreviousPageAsync();
127
+
}
128
+
}
129
+
```
130
+
131
+
## Update Page Size
132
+
133
+
The [UpdatePageSizeAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.SfPager.html#Syncfusion_Blazor_Navigations_SfPager_UpdatePageSizeAsync_System_Int32_) method updates the page size of the Pager component.
<SfButton @onclick="UpdatePageSize">Set Page Size to 20</SfButton>
145
+
146
+
@code
147
+
{
148
+
private SfPager? pager;
149
+
150
+
private async Task UpdatePageSize()
151
+
{
152
+
await pager?.UpdatePageSizeAsync(20);
153
+
}
154
+
}
155
+
```
156
+
157
+
## Update Numeric Items Count
158
+
159
+
The [UpdateNumericItemsCountAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.SfPager.html#Syncfusion_Blazor_Navigations_SfPager_UpdateNumericItemsCountAsync_System_Int32_) method updates the numeric item count displayed in the Pager.
<SfButton @onclick="UpdateNumericItemsCount">Set Numeric Items to 5</SfButton>
171
+
172
+
@code
173
+
{
174
+
private SfPager? pager;
175
+
176
+
private async Task UpdateNumericItemsCount()
177
+
{
178
+
await pager?.UpdateNumericItemsCountAsync(5);
179
+
}
180
+
}
181
+
```
182
+
183
+
## Refresh Pager
184
+
185
+
The [RefreshAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Navigations.SfPager.html#Syncfusion_Blazor_Navigations_SfPager_RefreshAsync) method applies all property changes and re-renders the Pager component.
0 commit comments