-
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
-
-
Reporting
-
AI-powered Extensions
-
Interaction
-
Report Types
-
Data binding
-
Real-life Reports
-
Layout Features
-
Report Controls
-
Web-specific Features
-
-
Rich Text Editor
- Overview
- Load/Save
- Document Protection
-
Templates
- Autocorrect
-
Customization
- Simple View
-
Spreadsheet
- Overview
-
Open a Document
- Export And Printing
-
Features
-
UI 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.
Form - Item Customization
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
@using DevExtreme.NETCore.Demos.ViewModels
@model FormViewModel
@(Html.DevExtreme().Form<FormViewModel>()
.FormData(Model)
.Items(items => {
items.AddGroup()
.Caption("Employee Details")
.ColCount(2)
.Items(groupItems => {
groupItems.AddSimpleFor(m => m.FirstName)
.Label(l => l.Template(new JS("nameLabel")))
.Editor(e => e
.TextBox()
.InputAttr("aria-label", "Name")
.Disabled(true)
);
groupItems.AddSimpleFor(m => m.Position)
.Label(l => l.Template(new JS("positionLabel")))
.Editor(e => e
.SelectBox()
.DataSource(new[] {
"HR Manager",
"IT Manager",
"CEO",
"Controller",
"Sales Manager",
"Support Manager",
"Shipping Manager"
})
.SearchEnabled(true)
.InputAttr("aria-label", "Position")
.Value("")
)
.ValidationRules(r => r
.AddRequired()
.Message("Position is required")
);
groupItems.AddSimpleFor(m => m.LastName)
.Label(l => l.Template(new JS("nameLabel")))
.Editor(e => e
.TextBox()
.InputAttr("aria-label", "Last Name")
.Disabled(true)
);
groupItems.AddSimpleFor(m => m.HireDate)
.Label(l => l.Template(new JS("eventLabel")))
.Editor(e => e
.DateBox()
.InputAttr("aria-label", "Hire Date")
.Value(new JS("null"))
.Width("100%")
)
.ValidationRules(r => r
.AddRequired()
.Message("Hire date is required")
);
groupItems.AddSimpleFor(m => m.BirthDate)
.Label(l => l.Template(new JS("eventLabel")))
.Editor(e => e
.DateBox()
.InputAttr("aria-label", "Birth Date")
.Disabled(true)
.Width("100%")
)
.IsRequired(false);
groupItems.AddSimpleFor(m => m.Address)
.Label(l => l.Template(new JS("addressLabel")));
groupItems.AddSimpleFor(m => m.Notes)
.Label(l => l.Template(new TemplateName("notesTemplate")))
.ColSpan(2)
.Editor(e => e
.TextArea()
.InputAttr("aria-label", "Notes")
.Height(90)
.MaxLength(200)
);
groupItems.AddSimpleFor(m => m.Phone)
.Label(l => l.Template(new JS("phoneLabel")))
.Editor(e => e
.TextBox()
.Mask("+1 (X00) 000-0000")
.InputAttr("aria-label", "Mask")
.MaskRules(new { X = new JS("/[02-9]/") })
);
groupItems.AddSimpleFor(m => m.Email)
.Label(l => l.Template(new JS("emailLabel")));
});
})
.OnContentReady("validateForm")
)
@using (Html.DevExtreme().NamedTemplate("notesTemplate")) {
<div id='template-content'>
<i
id="helpedInfo"
class="dx-icon dx-icon-info"
></i>
Additional
<br>
Notes:
</div>
@(Html.DevExtreme().Tooltip()
.Target("#helpedInfo")
.ShowEvent("mouseenter")
.HideEvent("mouseleave")
.ContentTemplate(@<text><div id='tooltip-content'>This field must not exceed 200 characters</div></text>)
)
}
<script>
function nameLabel(data) {
return $(`<div><i class='dx-icon dx-icon-user'}></i>${data.text}</div>`);
}
function positionLabel(data) {
return $(`<div><i class='dx-icon dx-icon-info'}></i>${data.text}</div>`);
}
function eventLabel(data) {
return $(`<div><i class='dx-icon dx-icon-event'}></i>${data.text}</div>`);
}
function phoneLabel(data) {
return $(`<div><i class='dx-icon dx-icon-tel'}></i>${data.text}</div>`);
}
function addressLabel(data) {
return $(`<div><i class='dx-icon dx-icon-home'}></i>${data.text}</div>`);
}
function emailLabel(data) {
return $(`<div><i class='dx-icon dx-icon-email'}></i>${data.text}</div>`);
}
function validateForm(e) {
e.component.validate();
}
</script>
using DevExtreme.AspNet.Data;
using DevExtreme.AspNet.Mvc;
using DevExtreme.NETCore.Demos.Models.SampleData;
using DevExtreme.NETCore.Demos.ViewModels;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
namespace DevExtreme.NETCore.Demos.Controllers {
public class FormController : Controller {
public ActionResult ItemCustomization() {
return View(new FormViewModel {
ID = 1,
FirstName = "John",
LastName = "Heart",
Phone = "360-684-1334",
Position = "CEO",
BirthDate = DateTime.Parse("1964/03/16"),
HireDate = DateTime.Parse("1995/01/15"),
Notes = "John has been in the Audio/Video industry since 1990. He has led DevAv as its CEO since 2003.\r\n\r\nWhen not working hard as the CEO, John loves to golf and bowl. He once bowled a perfect game of 300.",
Address = "351 S Hill St., Los Angeles, CA",
Email = "jheart@dx-email.com"
});
}
}
}
#helpedInfo {
color: #42a5f5;
}
#tooltip-content {
font-size: 14px;
font-weight: bold;
}
#template-content {
display: inline-flex;
}
To change the default settings, declare an item configuration object. Use the dataField property to bind an item to a field in the formData object. Use the editorType property to specify an item's data editor or configure the editor in the editorOptions object. You can also specify any other properties described in the SimpleItem section.
To customize item labels, use the label.template property. The demo uses this property to add icons to the labels. Refer to the Additional Notes item's implementation for instructions on how to add an icon with a tooltip to the label.
This demo shows how to specify editorOptions, editorType, validationRules, and colSpan properties for simple items in a Form component.