How does data binding and MVVM work with DevExpress WPF controls?

DevExpress WPF Advanced 3–5 Yrs5+ Yrs Conceptual 1 min read

Quick Answer

DevExpress WPF controls bind like any WPF control — GridControl.ItemsSource to an ObservableCollection, columns bound by FieldName. DevExpress also ships an MVVM framework: POCO view models (auto-generated INotifyPropertyChanged and commands), DXBinding (expressions in XAML), and behaviours/services for dialogs and navigation.

DevExpress WPF controls are still WPF controls, so the basics are standard — bind the GridControl's ItemsSource to an ObservableCollection on the view model, bind columns by field name. DevExpress adds its own MVVM framework on top: POCO view models where you don't write the INotifyPropertyChanged boilerplate, delegate commands generated from method names, and DXBinding for putting expressions right in the XAML. For large datasets you switch the grid to a server-mode source so it doesn't materialise everything. If a team isn't already using the DX MVVM framework I wouldn't force it — plain ICommand works fine.

  • POCO view models: mark the class, and DevExpress generates change notification for virtual auto-properties and delegate commands from OnXxxCommand methods.
  • GridControl respects INotifyCollectionChanged; for very large data use a server-mode source instead of loading everything.
  • Editing: the grid works with the view model's collection and validation attributes; commit on cell/row change.
  • Prefer the standard WPF ICommand / INotifyPropertyChanged if the team isn't already invested in the DX MVVM framework.