[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]ASP.NET WebForms Controls
 [Collapse]ASP.NET MVC Extensions
  [Expand]Product Information
  [Expand]Getting Started
  [Expand]Common Concepts
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Pivot Grid
   Rich Text Editor
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Vertical Grid
  [Collapse]Data Editors
    Editor List
    Main Features
   [Collapse]Common Concepts
    [Collapse]Binding Data Editors to Data
      Binding to Large Data (Database Server Mode)
     Getting Editor Values
     Mask Editing
     Accessibility Support
    Filter Control
    Validation Summary
   [Expand]Strongly-Typed Editor Types
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Extensions
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Binding Data Editors to Data

To bind a DevExpress editor to a value, use the editor's EditorExtension.Bind method. It has two overloads, allowing you to bind an editor either directly to its value or to a specific property of a data object (Model).

Note, that you can use strongly typed data editors that can be bound to a model's property using a lambda expression.

Expanded Binding to Model

When DevExpress editors are bound to data model fields (by using Bind(dataObject, propertyName) methods or using strongly typed helpers), the DevExpressEditorsBinder model binder must be used instead of the default model binder to correctly transfer values from DevExpress editors back to corresponding data model fields.

You can specify DevExpressEditorsBinder as a model binder in the following manners.

  • Decorating the Parameter of Action Method

    You can declare DevExpressEditorsBinder as a parameter attribute on an action method: ([ModelBinder(typeof(DevExpressEditorsBinder))])


  • Overriding the Default Model Binder

    You can assign DevExpressEditorsBinder to the ModelBinders.Binders.DefaultBinder property to replace the global default model binder.



Starting with v2012 vol 1, DevExpressEditorsBinder is automatically defined as a default model binder within projects created with the help of DevExpress MVC project templates.

Expanded List Editors Binding

List editors additionally implement the BindList method. It allows you to provide list editors with item list data.

The table below contains links to list editor related BindList methods.

Editor Method
CheckBoxList CheckBoxListExtension.BindList
ComboBox ComboBoxExtension.BindList
GridLookup GridLookupExtension.BindList
ListBox ListBoxExtension.BindList
RadioButtonList RadioButtonListExtension.BindList
TokenBox TokenBoxExtension.BindList
TrackBar TrackBarExtension.BindList

Expanded Example

The code below demonstrates how the Bind and BindList methods can be used to bind the TextBox and ComboBox (see GridView - External Edit Form online demo for more code).

View Code - "EditingForm" (ASPX):

View Code - "EditingForm" (Razor):

Expanded See Also

Is this topic helpful?​​​​​​​