-
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
-
Reporting
-
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
-
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
Related Demos:
Your search did not match any results.
Form - Customize Item
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 CustomizeItem() {
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.