[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Collapse]Scheduler
   [Expand]Getting Started
   [Expand]Appointments
    Resources
    Reminders
   [Expand]Views
   [Expand]Visual Elements
   [Expand]Styles and Templates
   [Expand]Design-Time Features
    Time Zones
   [Collapse]Data Binding
     Mappings
     Mapping Converters
     Custom Fields
    Appearance Customization
    Grouping
    Selecting
    Clipboard Operations
    Printing Templates
    Drag and Drop Customization
    Navigating
    Printing
    End-User Restrictions
   [Expand]Examples
    Migration Guidelines
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Custom Fields

Custom fields allow you to extend the set of properties of a persistent object, such as Appointments, Resources, Labels and Statuses. You can define custom data fields, map them to custom properties of persistent objects and use these user-defined property values in your code.

To create a custom field mapping, perform the following steps:

  • choose a name that is not on the list of the standard persistent object properties (see the Mappings document)
  • create a custom field mapping in XAML by declaring a CustomFieldMapping within the mappings
  • use the selected name to specify the CustomFieldMapping.Name property value

To obtain a custom field value, use the SourceObjectContainer.CustomFields property and access the required field by its name.

To explain the custom fields technique in more detail, consider the situation when a resource has an associated picture. To display the picture in the resource header, create a custom field that allows obtaining a picture using the ResourceItem custom property value. The picture is contained in the ResourceImage field of the ResourceItem's source object. The Photo will be the name of a custom property. The following code creates the required custom mapping:

To display an image in the resource header, create a custom data template in which use the Resource.CustomFields.Photo path for image data binding. Assign the data template to the SchedulerViewBase.ResourceHeaderContentTemplate property.

The following code defines a resource header's data template. It has a gray background, shows an image obtained using the Custom Fields and displays the ResourceItem.Caption text with a custom font. The data template is assigned to the SchedulerViewBase.ResourceHeaderContentTemplate property.

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