-
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
Tab Panel - Templates
This demo illustrates the use of templates in TabPanel. If your data objects contain custom fields, you need to specify the itemTitleTemplate and itemTemplate that define how to display the fields in tabs and views.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
@(Html.DevExtreme().TabPanel()
.ID("tabpanel-container")
.Height(260)
.DataSource(d => d.Mvc().LoadAction("GetCompanies"))
.SelectedIndex(0)
.Loop(false)
.AnimationEnabled(true)
.SwipeEnabled(true)
.ItemTitleTemplate(@<text><span><%- Name %></span></text>)
.ItemTemplate(@<text>
<div class="tabpanel-item">
<div>
<p>
<span><%- Address %></span>
</p>
<p>
<span><b><%- City %></b>,</span>
<span><%- State %></span>
<span><%- ZipCode %></span>
</p>
</div>
<div>
<p>Phone: <b><%- Phone %></b></p>
<p>Fax: <b><%- Fax %></b></p>
<p>
Website:
<a href="<%- Website %>" rel="noreferrer" target="_blank"><%- Website %></a>
</p>
</div>
</div>
</text>)
.OnSelectionChanged("tabPanelSelection_changed")
)
<div class="item-box">
Item <span class="selected-index">1</span>
of <span>4</span>
</div>
<div class="options">
<div class="caption">Options</div>
<div class="option">
@(Html.DevExtreme().CheckBox()
.Value(false)
.Text("Loop enabled")
.OnValueChanged("loopEnabled")
)
</div>
<div class="option">
@(Html.DevExtreme().CheckBox()
.Value(true)
.Text("Animation enabled")
.OnValueChanged("animationEnabled")
)
</div>
<div class="option">
@(Html.DevExtreme().CheckBox()
.Value(true)
.Text("Swipe enabled")
.OnValueChanged("swipeEnabled")
)
</div>
</div>
<script>
function tabPanelSelection_changed(e) {
$(".selected-index")
.text(e.component.option("selectedIndex") + 1);
}
function getTabPanelInstance() {
return $("#tabpanel-container").dxTabPanel("instance");
}
function loopEnabled(e) {
getTabPanelInstance().option("loop", e.value);
}
function animationEnabled(e) {
getTabPanelInstance().option("animationEnabled", e.value);
}
function swipeEnabled(e) {
getTabPanelInstance().option("swipeEnabled", e.value);
}
</script>
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
If you want each tab and view to have differently structured content, define individual templates. To do this, assign an array of objects to the items[] or dataSource property and specify the tabTemplate and template properties in each object. This use case is illustrated in the following tutorial: Getting Started with TabPanel.
Use the following properties to configure user navigation between tabs:
-
swipeEnabled
Defines whether to switch between views with a swipe gesture. -
loop
Specifies whether to loop views. -
animationEnabled
Specifies whether to animate transition between views.
You can switch the checkboxes below the TabPanel to change the loop, animationEnabled, and swipeEnabled property values.