-
Data Grids / Data Management
-
Data Grid
- Overview
-
Data Binding
-
Filtering
- Sorting
-
Editing
-
Grouping
-
Selection
- Focused Row
- Paging
-
Scrolling
-
Columns
-
Master-Detail
-
Data Summaries
-
Drag & Drop
-
Export to PDF
-
Export to Excel
- Appearance
-
Customization
- State Persistence
-
Adaptability
-
Keyboard Navigation
- Right-To-Left Support
-
Tree List
- Overview
-
Data Binding
-
Filtering
- Sorting
-
Editing
-
Selection
- Focused Row
- Paging
-
Columns
- Drag & Drop
- State Persistence
- Adaptability
-
Keyboard Navigation
-
Card View
-
Pivot Grid
- Overview
-
Data Binding
-
Field Management
-
Data Summaries
- Drill Down
- Filtering
-
Scrolling
-
Export to Excel
- Chart Integration
- Customization
- State Persistence
-
Filter Builder
-
-
Data Visualization
-
Charts
- Overview
-
Data Binding
-
Common Concepts
-
Axis
-
Aggregation
-
Tooltips
-
Selection
-
Customization
-
Zooming
-
Export
-
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Funnel and Pyramid Charts
-
Line Charts
- Pareto Chart
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
- Sankey Chart
-
Sparkline Charts
-
Tree Map
-
Gauges
- Overview
-
Runtime update
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
-
Scheduling / Planning
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Appointments
-
Timetable
- Editing
-
Grouping
- Virtual Scrolling
- Drag & Drop
-
Customization
- Adaptability
-
Gantt
- Overview
- Data Binding
-
Filtering
- Sorting
- Strip Lines
- Export to PDF
- Validation
-
Customization
-
-
Messaging
-
WYSIWYG Editor
-
Forms
-
Data Editors
- Overview
-
Common Concepts
-
Calendar
- Check Box
- Color Box
- Date Box
-
Date Range Box
-
Number Box
- Radio Group
-
Range Selector
- Range Slider
- Slider
- Switch
- Text Area
- Text Box
-
Drop-Downs
- Autocomplete
-
Drop Down Box
-
Select Box
-
Tag Box
-
Lookup
-
Buttons
-
File Upload / File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Popup and Notifications
-
Navigation
- Overview
- Accordion
-
Context Menu
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
-
Stepper
- Pagination
-
List
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
-
-
Interactive Wrappers
-
Sortable
- Resizable
-
-
Progress Indicators
-
Maps
- Overview
-
Map
-
Vector Map
-
Data Binding
- Multiple Layers
-
Markers
- Legend
-
Zooming and Panning
-
Customization
-
-
Localization
Related Demos:
Your search did not match any results.
Pagination
DevExpress Pagination component allows users to navigate between pages and adjust page size at runtime. In this demo, users can browse through individual employee cards using the Pagination component.
To set up our Pagination component, specify the following options:
- itemCount: the total number of elements in the target control.
- pageSize: the number of items per page.
- allowedPageSizes: available page size choices.
- pageIndex: page displayed first.
- showNavigationButtons: navigation button visibility.
- showInfo: information pane visibility.
Was this demo helpful?
Feel free to share demo-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Backend API
@model IEnumerable<DevExtreme.MVC.Demos.Models.Pagination.Employee>
<div class="container">
<div id="employees" class="employees"></div>
<div id="pagination">
@(
Html.DevExtreme().Pagination()
.ID("pagination")
.ShowInfo(true)
.ShowNavigationButtons(true)
.AllowedPageSizes(new[] { 4, 6 })
.ItemCount(Model.Count())
.PageIndex(1)
.PageSize(4)
.OnOptionChanged("pagination_optionChanged")
.OnInitialized("pagination_onInitialized")
)
</div>
</div>
<script>
const employees = @Html.Raw(System.Text.Json.JsonSerializer.Serialize(Model));
function getPaginationInstance() {
return $("#pagination").dxPagination("instance");
};
const pagination_onInitialized = () => {
const pagination = getPaginationInstance();
renderEmployeeGallery(pagination.option('pageSize'), pagination.option('pageIndex'));
};
const pagination_optionChanged = (evt) => {
const pagination = getPaginationInstance();
if (evt.name === 'pageSize') {
const pageSize = evt.value;
pagination.option('pageSize', pageSize);
const pageIndex = pagination.option('pageIndex');
renderEmployeeGallery(pageSize, pageIndex);
}
if (evt.name === 'pageIndex') {
const pageSize = pagination.option('pageSize');
const pageIndex = evt.value;
pagination.option('pageIndex', pageIndex);
renderEmployeeGallery(pageSize, pageIndex);
}
};
const createEmployeeImg = (employee) => {
const imageWrapper = $('<div>').addClass('employees__img-wrapper');
const img = $('<img>').addClass('employees__img');
img.attr({ src: employee.Picture, alt: employee.FullName });
imageWrapper.append(img);
return imageWrapper;
};
const createEmployeeInfo = (employee) => {
const employeeInfo = $('<div>').addClass('employees__info');
const fullNameWrapper = $('<div>').addClass('employees__info-row');
const fullNameLabel = $('<span>').addClass('employees__info-label').text('Full Name:');
const fullName = $('<span>').addClass('employees__info-value').text(employee.FullName);
fullNameWrapper.append(fullNameLabel);
fullNameWrapper.append(fullName);
const positionWrapper = $('<div>').addClass('employees__info-row');
const positionLabel = $('<span>').addClass('employees__info-label').text('Position:');
const position = $('<span>').addClass('employees__info-value').text(employee.Position);
positionWrapper.append(positionLabel);
positionWrapper.append(position);
const phoneWrapper = $('<div>').addClass('employees__info-row');
const phoneLabel = $('<span>').addClass('employees__info-label').text('Phone:');
const phone = $('<span>').addClass('employees__info-value').text(employee.Phone);
phoneWrapper.append(phoneLabel);
phoneWrapper.append(phone);
employeeInfo.append(fullNameWrapper);
employeeInfo.append(positionWrapper);
employeeInfo.append(phoneWrapper);
return employeeInfo;
};
const createEmployeeCard = (employee) => {
const cardEl = $('<div>').addClass('employees__card');
const imageWrapper = createEmployeeImg(employee);
const employeeInfo = createEmployeeInfo(employee);
cardEl.append(imageWrapper);
cardEl.append(employeeInfo);
return cardEl;
};
const renderEmployeeGallery = (pageSize, pageIndex) => {
const $employeesContainer = $('#employees');
$employeesContainer.empty();
if (pageSize === 4) {
$employeesContainer.removeClass('employees--six');
$employeesContainer.addClass('employees--forth');
} else {
$employeesContainer.removeClass('employees--forth');
$employeesContainer.addClass('employees--six');
}
const pageEmployees = employees.slice((pageIndex - 1) * pageSize, pageIndex * pageSize);
pageEmployees.forEach((employee) => {
const card = createEmployeeCard(employee);
$employeesContainer.append(card);
});
};
</script>
using System.Web.Mvc;
using DevExtreme.MVC.Demos.Models.SampleData;
namespace DevExtreme.MVC.Demos.Controllers {
public class PaginationController : Controller {
public ActionResult Overview() {
return View(SampleData.PaginationEmployees);
}
}
}
body {
overflow-x: hidden;
}
.demo-container {
display: flex;
flex-direction: column;
align-items: center;
}
.container {
min-width: 720px;
width: 100%;
}
.employees {
display: flex;
flex-wrap: wrap;
gap: 16px;
min-height: 644px;
padding-bottom: 24px;
}
.employees__card {
width: 100%;
max-height: 312px;
align-self: stretch;
overflow: hidden;
border: var(--dx-border-width) solid var(--dx-color-border);
border-radius: var(--dx-border-radius);
background-color: var(--dx-component-color-bg);
}
.employees.employees--forth .employees__card {
min-width: 250px;
width: 390px;
flex-basis: calc(50% - 10px);
}
.employees.employees--six .employees__card {
flex-basis: calc(33.3% - 12.5px);
}
.employees__img-wrapper {
height: 180px;
position: relative;
overflow: hidden;
border-bottom: var(--dx-border-width) solid var(--dx-color-border);
background-color: #fff;
}
.employees__img {
display: block;
height: 220px;
position: absolute;
content: "";
left: 50%;
top: 0;
transform: translateX(-50%);
}
.employees__info {
padding: 24px;
}
.employees__info-row {
margin-bottom: 8px;
text-wrap: nowrap;
}
.employees__info-label {
display: inline-block;
font-weight: 600;
vertical-align: middle;
}
.employees.employees--forth .employees__info-label {
width: 160px;
}
.employees.employees--six .employees__info-label {
width: 80px;
}
.employees__info-value {
display: inline-block;
text-wrap: nowrap;
text-overflow: ellipsis;
vertical-align: middle;
overflow: hidden;
white-space: nowrap
}
.employees.employees--forth .employees__info-value {
max-width: 180px;
}
.employees.employees--six .employees__info-value {
max-width: 120px;
}