-
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
Form - Overview
The Form component builds a data entry UI for an object assigned to the formData property. The component displays and aligns label-editor pairs for each field in the bound object.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
@model DevExtreme.MVC.Demos.Models.ActiveCompany
<div id="form-demo">
<div class="widget-container">
<div id="companySelectText">Select company:</div>
@(Html.DevExtreme().SelectBox()
.ID("companySelectBox")
.DisplayExpr("Name")
.InputAttr("aria-label", "Company")
.Label("Select company")
.LabelMode(EditorLabelMode.Floating)
.DataSource(d => d.Mvc().LoadAction("GetCompanies").Key("ID"))
.Value(1)
.OnValueChanged("selectBox_valueChanged")
)
@(Html.DevExtreme().Form()
.ID("form")
.ColCount(2)
.FormData(Model)
.LabelMode(FormLabelMode.Floating)
.LabelLocation(FormLabelLocation.Left)
.MinColWidth(300)
.ReadOnly(false)
.ShowColonAfterLabel(true)
)
</div>
<div class="options">
<div class="caption">Options</div>
<div class="option">
<span>Label mode:</span>
@(Html.DevExtreme().SelectBox()
.InputAttr("aria-label", "Label Mode")
.DataSource(new[] { "outside", "static", "floating", "hidden" })
.Value("floating")
.OnValueChanged("labelMode_changed")
)
</div>
<div class="option">
<span>Label location:</span>
@(Html.DevExtreme().SelectBox()
.DataSource(new[] { "left", "top" })
.InputAttr("aria-label", "Label Location")
.Value("left")
.OnValueChanged("labelLocation_changed")
)
</div>
<div class="option">
<span>Columns count:</span>
@(Html.DevExtreme().SelectBox()
.DataSource(new object[] { "auto", 1, 2, 3 })
.Value(2)
.InputAttr("aria-label", "Column Count")
.OnValueChanged("colCount_changed")
)
</div>
<div class="option">
<span>Min column width:</span>
@(Html.DevExtreme().SelectBox()
.DataSource(new[] { 150, 200, 300 })
.Value(300)
.InputAttr("aria-label", "Min Column Width")
.OnValueChanged("minColWidth_changed")
)
</div>
<div class="option">
<span>Form width:</span>
@(Html.DevExtreme().NumberBox()
.Value(null)
.Max(550)
.InputAttr("aria-label", "Width")
.OnValueChanged("formWidth_changed")
)
</div>
<div class="option">
@(Html.DevExtreme().CheckBox()
.Text("readOnly")
.Value(false)
.OnValueChanged("readOnly_changed")
)
</div>
<div class="option">
@(Html.DevExtreme().CheckBox()
.Text("showColonAfterLabel")
.Value(true)
.OnValueChanged("showColonAfterLabel_changed")
)
</div>
</div>
</div>
<script>
function getFormInstance() {
return $("#form").dxForm("instance");
}
function selectBox_valueChanged(data) {
getFormInstance().option("formData", data.value);
}
function labelMode_changed(data) {
getFormInstance().option("labelMode", data.value);
const $companySelectText = $("#companySelectText");
const companySelectBox = $("#companySelectBox").dxSelectBox("instance");
if(data.value === "outside") {
companySelectBox.option("labelMode", "hidden");
$companySelectText.show();
} else {
companySelectBox.option("labelMode", data.value);
$companySelectText.hide();
}
}
function labelLocation_changed(data) {
getFormInstance().option("labelLocation", data.value);
}
function colCount_changed(data) {
getFormInstance().option("colCount", data.value);
}
function minColWidth_changed(data) {
getFormInstance().option("minColWidth", data.value);
}
function formWidth_changed(data) {
getFormInstance().option("width", data.value);
}
function readOnly_changed(data) {
getFormInstance().option("readOnly", data.value);
}
function showColonAfterLabel_changed(data) {
getFormInstance().option("showColonAfterLabel", data.value);
}
</script>
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
xxxxxxxxxx
You can use the editors on the right to modify the following properties:
-
labelMode: "outside" | "static" | "floating" | "hidden"
Specifies label display mode. -
labelLocation: "top" | "left" | "right"
Specifies whether to place outer labels above, to the left, or to the right of corresponding editors. The latter location is not demonstrated in this example. -
colCount
Specifies the number of columns in the layout. To build an adaptive layout where the column count depends on the container width, set this property's value to "auto". -
minColWidth
Specifies the minimum column width. Use this property when the colCount property's value is "auto". -
width
Specifies the Form component's width. -
readOnly
Makes the Form editors read-only. -
showColonAfterLabel
Specifies whether the Form displays a colon after a label.
To get started with the DevExtreme Form component, refer to the following tutorial for step-by-step instructions: Getting Started with Form.