Skip to content

Commit 49f19c6

Browse files
svdimitrmarin-bratanov
authored andcommitted
docs(pager): adding configuration in config.yml; Creating folder and overview.md
1 parent f19569a commit 49f19c6

File tree

2 files changed

+98
-8
lines changed

2 files changed

+98
-8
lines changed

_config.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ navigation:
5656
"backwards-compatibility":
5757
title: "Breaking Changes"
5858
position: 30
59-
59+
6060
## List custom TOC order for folders here
6161

6262
"*components/grid/columns":
@@ -154,7 +154,7 @@ navigation:
154154
"*datepicker":
155155
title: "Date Picker"
156156
"*daterangepicker":
157-
title: "DateRangePicker"
157+
title: "DateRangePicker"
158158
"*datetimepicker":
159159
title: "DateTime Picker"
160160
"*dialog":
@@ -206,6 +206,8 @@ navigation:
206206
title: "ResponsivePanel"
207207
"*panelbar":
208208
title: "PanelBar"
209+
"*pager":
210+
title: "Pager"
209211
"*pivotgrid":
210212
title: "PivotGrid"
211213
"*scheduler":
@@ -246,7 +248,7 @@ navigation:
246248
title: "Templates"
247249
"*switch":
248250
title: "Switch"
249-
251+
250252
## introduction article columns. Use the slugs in the items collection
251253

252254
api_reference_url: "api/"
@@ -259,21 +261,22 @@ intro_columns:
259261
items:
260262
"Grid": "components/grid/overview"
261263
"ListView": "listview-overview"
262-
264+
263265
-
264266
title: "Navigation"
265267
items:
266268
"Button": "components/button/overview"
267269
"Menu": "components/menu/overview"
268270
"Tab Strip": "components/tabstrip/overview"
269271
"TreeView": "components/treeview/overview"
272+
"Pager": "components-pager-overview"
270273

271274
-
272275
title: "Scheduling"
273276
items:
274277
"Scheduler": "scheduler-overview"
275278
"Calendar": "components/calendar/overview"
276-
279+
277280
-
278281
title: "Layout"
279282
items:
@@ -322,8 +325,8 @@ intro_columns:
322325
items:
323326
"File Upload": "upload-overview"
324327
-
325-
326-
328+
329+
327330
## The application virtual path
328331
baseurl: /blazor-ui
329332

@@ -351,7 +354,7 @@ defaults:
351354
category: "default"
352355
product: "blazor"
353356
editable: true
354-
357+
355358
-
356359
scope:
357360
path: "blazor"

components/pager/overview.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: Paging
3+
page_title: Pager for Blazor Overview
4+
description: Enable and configure paging in Grid for Blazor
5+
slug: components-pager-overview
6+
tags: telerik,blazor,pager,paging
7+
published: True
8+
position: 20
9+
---
10+
11+
# Grid Paging
12+
13+
The Grid component offers support for paging.
14+
15+
To enable paging, set its `Pageable` property to `true`.
16+
17+
You can control the number of records per page through the `PageSize` property.
18+
19+
You can set the current page of the grid through its integer `Page` property.
20+
21+
>caption Enable paging in Telerik Grid
22+
23+
````CSHTML
24+
Enable paging and start on the second page.
25+
26+
<TelerikGrid Data="@MyData" Pageable="true" PageSize="15" Page="2" Height="500px">
27+
<GridColumns>
28+
<GridColumn Field="ID"></GridColumn>
29+
<GridColumn Field="TheName" Title="Employee Name"></GridColumn>
30+
</GridColumns>
31+
</TelerikGrid>
32+
33+
@code {
34+
public IEnumerable<object> MyData = Enumerable.Range(1, 50).Select(x => new { ID = x, TheName = "name " + x });
35+
}
36+
````
37+
38+
>caption The result from the code snippet above
39+
40+
![](images/paging-overview.png)
41+
42+
>tip You can bind the values of those properties to variables in the `@code {}` section. If you want to bind the page index to a variable, you must use the `@bind-Page="@MyPageIndexVariable"` syntax.
43+
44+
Here is one way to implement a page size choice that puts all records on one page.
45+
46+
>caption Bind Page Size to a variable
47+
48+
````CSHTML
49+
Dynamic page size change
50+
51+
<select @onchange=@ChangePageSize>
52+
@for (int i = 1; i < 4; i++)
53+
{
54+
<option value=@(i*10)>@(i * 10)</option>
55+
}
56+
<option value="all" selected>all</option>
57+
</select>
58+
59+
<TelerikGrid Data="@MyData" Pageable="true" PageSize="@PageSize">
60+
<GridColumns>
61+
<GridColumn Field="ID"></GridColumn>
62+
<GridColumn Field="TheName" Title="Employee Name"></GridColumn>
63+
</GridColumns>
64+
</TelerikGrid>
65+
66+
@code {
67+
public IEnumerable<object> MyData = Enumerable.Range(1, 50).Select(x => new { ID = x, TheName = "name " + x });
68+
69+
protected int PageSize { get; set; }
70+
71+
protected void ChangePageSize(ChangeEventArgs e)
72+
{
73+
if (e.Value.ToString().ToLowerInvariant() == "all")
74+
{
75+
PageSize = MyData.Count();
76+
}
77+
else
78+
{
79+
PageSize = int.Parse(e.Value.ToString());
80+
}
81+
}
82+
}
83+
````
84+
85+
## See Also
86+
87+
* [Live Demo: Grid Paging](https://demos.telerik.com/blazor-ui/grid/paging)

0 commit comments

Comments
 (0)