Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Expand]Concepts
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Collapse]Task-Based Help
  [Expand]Business Model Design
  [Expand]Application Model
  [Expand]Actions
  [Expand]Navigation
  [Expand]Views
  [Expand]List Editors
  [Collapse]Property Editors
    How to: Customize a Built-in Property Editor (ASP.NET)
    How to: Customize a Built-in Property Editor (WinForms)
    How to: Disable and Hide Property Editors Based on a Business Rule
    How to: Display an Integer Property as an Enumeration
    How to: Implement a Property Editor Based on a Custom Control (WinForms)
    How to: Implement a Property Editor based on Custom Controls (ASP.NET)
    How to: Implement a Property Editor Using a DevExpress WinForms Control
    How to: Supply Predefined Values for the String Property Editor Dynamically (ASP.NET)
    How to: Supply Predefined Values for the String Property Editor Dynamically (WinForms)
    How to: Use Criteria Property Editors
  [Expand]Templates
  [Expand]Filtering
  [Expand]Reporting
  [Expand]Dashboards
  [Expand]Scheduler and Notifications
  [Expand]Maps
  [Expand]Security
  [Expand]Workflow
  [Expand]Localization
  [Expand]Testing
  [Expand]Miscellaneous UI Customizations
 [Expand]Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
[Expand]End-User Documentation

How to: Customize a Built-in Property Editor (ASP.NET)

This topic describes how to customize a built-in XAF Property Editor for ASP.NET (to see a similar example for WinForms, refer to How to: Customize a Built-in Property Editor (WinForms)).The ASPxDateTimePropertyEditor will be customized to display the calendar and the clock:

Note

You can see the code demonstrated here along with more examples on custom property editors in the Feature Center Demo installed with XAF. By default, the Feature Center demo is installed in %PUBLIC%\Documents\DevExpress Demos 17.1\Components\eXpressApp Framework\FeatureCenter. The ASP.NET version of this demo is available online at http://demos.devexpress.com/XAF/FeatureCenter/.

Expanded Inherit the Property Editor

In the ASP.NET module project, inherit the ASPxDateTimePropertyEditor class. Note that your editor should be public. To customize the Property Editor's control used in the edit mode, override the SetupControl method. To specify that the Property Editor can be used for the DateTime type properties, apply the PropertyEditorAttribute attribute:

Expanded Use the Customized Property Editor

To use the implemented Property Editor for a specific property, run the Model Editor in the APP.NET project and set the IModelCommonMemberViewItem.PropertyEditorType of the required OwnMember or ViewItem node to CustomDateTimeEditor.

Tip

To use the implemented Property Editor for all DateTime properties, set the defaultEditor parameter of the PropertyEditorAttribute.PropertyEditorAttribute constructor to true in the code above.

Note that the business class' property value associated with the created Property Editor should be formatted in order to display the time part of the DateTime value

For details, refer to the Format a Property Value topic.

Expanded See Also

How would you rate this topic?​​​​​​​