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
@@ -36,19 +38,52 @@ The `PageChanged` event fires a new page is selected. You can use it to implemen
36
38
public int ButtonCount { get; set; } = 4;
37
39
public int ItemsOnPage { get; set; } = 10;
38
40
public int CurrentPage { get; set; } = 2;
39
-
public string Result { get; set; } = String.Empty;
41
+
public string Result { get; set; }
40
42
41
-
void PageChangedHandler(int page)
43
+
void PageChangedHandler(int newPage)
42
44
{
43
-
CurrentPage = page;
44
-
Result = $"Current page: {page}";
45
+
CurrentPage = newPage;
46
+
Result = $"Current page: {newPage}";
45
47
}
46
48
}
47
49
````
48
50
>caption The result from the code snippet above
49
51
50
52

51
53
54
+
## PageSizeChanged
55
+
56
+
The `PageSizeChanged` event fires when the user changes the page size via the pager DropDownList. The existence of this event also ensures that the `PageSize` attribute supports two-way binding.
57
+
58
+
If the user selects the "All" option from the page size DropDownList, the `PageSizeChanged` event will receive the total item count as an argument.
59
+
60
+
Make sure to update the current page size when using the event.
Copy file name to clipboardExpand all lines: components/pager/overview.md
+15-9Lines changed: 15 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,11 +83,13 @@ The Pager provides the UI for the user to change the page. To the developer, it
83
83
84
84
## Features
85
85
86
+
*`Total` - `int` - Represents the total count of items in the pager. **Required.**
87
+
*`ButtonCount` - `int` - The maximum number of page buttons that will be visible. To take effect, `ButtonCount` must be smaller than the page count (`ButtonCount < Total / PageSize`).
88
+
*`Page` - `int` - Represents the current page of the pager. The first page has an index of `1`. Supports two-way data binding. If no value is provided, the parameter will default to the first page (1), but you should always use this parameter value in order to successfully use the component. If you don't use two-way binding and you don't update the value of the parameter after the user action, the pager UI will not reflect the change and will revert to the previous value (page index).
89
+
*`PageSize` - `int` - The number of items to display on a page.
90
+
*`PageSizes` - `List<int?>` - Allows users to change the page size via a DropDownList. The attribute configures the DropDownList options. A `null` item in the `PageSizes``List` will render an "All" option. By default, the Pager DropDownList is not displayed. You can also set `PageSizes` to `null` programmatically to remove the DropDownList at any time.
91
+
*`InputType` - `PagerInputType` - Determines if the pager will show numeric buttons to go to a specific page, or a textbox to type the page index. The arrow buttons are always visible. The `PagerInputType` enum accepts values `Buttons` (default) or `Input`. When `Input` is used, the page index will change when the textbox is blurred, or when the user hits Enter. This is to avoid unintentional data requests.
86
92
*`Class` - The CSS class that will be rendered on the main wrapping element of the Pager.
87
-
*`Total` - `int - Represents the total count of items in the pager. Required.
88
-
*`ButtonCount` - `int` - The maximum number of page buttons that will be visible. To take effect the `ButtonCount` must be smaller than the pages count (`ButtonCount < Total / PageSize`).
89
-
*`Page` - `int` - Represents the current page of the pager. The first page has an index of `1`. Supports two-way data binding. If no value is provided the parameter will default to the first page (1), but you should always use this parameter value in order to successfully use the component. If you don't use two-way binding and you don't update the value of the parameter after the user action, the pager UI will not reflect the change and will revert to the previous value (page index).
90
-
*`PageSize` - `int` - The number of items to be presented on a page.
91
93
92
94
## Examples
93
95
@@ -115,14 +117,18 @@ You can avoid loading all the data at once, as this can be a costly operation. I
0 commit comments