-
Data Grid
- Overview
-
Data Binding
-
Paging and Scrolling
-
Editing
-
Grouping
-
Filtering and Sorting
- Focused Row
-
Row Drag & Drop
-
Selection
-
Columns
- State Persistence
-
Appearance
-
Templates
-
Data Summaries
-
Master-Detail
-
Export to PDF
-
Export to Excel
-
Adaptability
- Keyboard Navigation
-
Pivot Grid
- Overview
-
Data Binding
-
Field Chooser
-
Features
-
Export to Excel
-
Tree List
- Overview
-
Data Binding
- Sorting
- Paging
-
Editing
- Node Drag & Drop
- Focused Row
-
Selection
-
Filtering
-
Column Customization
- State Persistence
- Adaptability
- Keyboard Navigation
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Features
- Virtual Scrolling
-
Grouping
-
Customization
- Adaptability
-
Html Editor
-
Chat
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
Charts
- Overview
-
Data Binding
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Line Charts
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
-
Sparkline Charts
-
Tree Map
-
Funnel and Pyramid Charts
- Sankey Chart
-
Combinations
-
More Features
-
Export
-
Selection
-
Tooltips
-
Zooming
-
-
Gantt
- Overview
-
Data
-
UI Customization
- Strip Lines
- Export to PDF
- Sorting
-
Filtering
-
Gauges
- Overview
-
Data Binding
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Navigation
- Overview
- Accordion
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
- Resizable
-
-
Editors
- Overview
- Autocomplete
-
Calendar
- Check Box
- Color Box
- Date Box
-
Date Range Box
-
Drop Down Box
-
Number Box
-
Select Box
- Switch
-
Tag Box
- Text Area
- Text Box
- Validation
- Custom Text Editor Buttons
- Right-to-Left Support
- Editor Appearance Variants
-
Forms and Multi-Purpose
- Overview
- Button Group
- Field Set
-
Filter Builder
-
Form
- Radio Group
-
Range Selector
- Numeric Scale (Lightweight)
- Numeric Scale
- Date-Time Scale (Lightweight)
- Date-Time Scale
- Logarithmic Scale
- Discrete scale
- Custom Formatting
- Use Range Selection for Calculation
- Use Range Selection for Filtering
- Image on Background
- Chart on Background
- Customized Chart on Background
- Chart on Background with Series Template
- Range Slider
- Slider
-
Sortable
-
File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Actions and Lists
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
List - List Selection
There are three List item selection modes: "single", "multiple", and "all". To enable item selection, pass the mode name to the selectionMode property. If you set this property to "none" (default setting), item selection is disabled. In this demo, you can try out all the selection modes. Use the drop-down Selection Mode menu to switch between modes.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
@model IEnumerable<DevExtreme.MVC.Demos.Models.ListItem>
<div id="list-demo">
<div class="widget-container">
@(Html.DevExtreme().List()
.ID("simpleList")
.Height(400)
.ShowSelectionControls(true)
.SelectionMode(ListSelectionMode.All)
.SelectByClick(false)
.DataSource(Model, "ID")
.ItemTemplate(@<text><%- Text %></text>)
.OnSelectionChanged(@<text>
function(data) {
$("#selectedItemKeys").text(data.component.option("selectedItemKeys").join(", "));
}
</text>)
)
<div class="selected-data">
<span class="caption">Selected IDs: </span>
<span id="selectedItemKeys"></span>
</div>
</div>
<div class="options">
<div class="caption">Options</div>
<div class="option">
<span>Selection Mode</span>
@(Html.DevExtreme().SelectBox()
.Value(ListSelectionMode.All)
.InputAttr("aria-label", "Selection Mode")
.DataSource(Enum.GetValues(typeof(ListSelectionMode)))
.OnValueChanged(@<text>
function(data) {
$("#simpleList").dxList("option", "selectionMode", data.value);
$("#selectAllMode").dxSelectBox("option", "disabled", data.value !== "all");
}
</text>)
)
</div>
<div class="option">
<span>Select All Mode</span>
@(Html.DevExtreme().SelectBox()
.ID("selectAllMode")
.Disabled(false)
.InputAttr("aria-label", "Select All Mode")
.DataSource(Enum.GetValues(typeof(SelectAllMode)))
.Value(SelectAllMode.Page)
.OnValueChanged(@<text>
function(data) {
$("#simpleList").dxList("option", "selectAllMode", data.value);
}
</text>)
)
</div>
<div class="option">
<span>Select By Click</span>
@(Html.DevExtreme().CheckBox()
.ID("selectByClick")
.Value(false)
.ElementAttr("aria-label", "Selection By Click")
.OnValueChanged(@<text>
function(data) {
$("#simpleList").dxList("option", "selectByClick", data.value);
}
</text>)
)
</div>
</div>
</div>
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
List items can display checkboxes or radio buttons. To show these controls, enable the showSelectionControls property. Otherwise, users can click or tap list items to select them. The showSelectionControls property should also be enabled when you use the "all" selectionMode to show the Select All checkbox.
When the List data is paginated, you can choose whether the Select All checkbox selects all items on all pages or only the items on the current page. To configure this functionality, set the selectAllMode property to "allPages" or "page". In this demo, you can use the drop-down Select All Mode menu to change the selectAllMode property at runtime.
To configure the initial selection or access the keys of selected items, use the selectedItemKeys array. This example shows the contents of this array in the Selected IDs section below the List.
You can also implement the onSelectionChanged event handler to perform an action when users select items.