Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • There are several ways to assign a property editor to a property:


                                    1. Assign a property editor via the application model.

                                    1.1. Specify a default property editor for a property type via the EditorType property of the ViewItems/PropertyEditors/<TypeName> model node.

                                    1.2. Specify a property editor for a class property via the PropertyEditorType property of the BOModel/<ClassName>/OwnMembers/<PropertyName> model node. It is the default property editor used for this property in list and detail views.

                                    1.3. Specify a property editor for a detail view item via the PropertyEditorType property of the Views/<DetailViewName>/Items/<ItemName> model node.

                                    1.4. Specify a property editor for a list view column via the PropertyEditorType property of the Views/<ListViewName>/Columns/<ColumnName> model node.


                                    2. Assign a property editor in source code (via attributes). These attributes are taken into account when the application model is being generated.

                                    2.1. Specify a default property editor when registering a property editor. When creating a custom property editor, you decorate the editor class with the PropertyEditor attribute, where you can specify the property type for which the editor can be selected and set the isDefaultEditor property to True to use it for this type by default.

                                    [C#]
                                    [PropertyEditor(typeof(String), true)] public class CustomStringEditor : StringPropertyEditor { public CustomStringEditor(Type objectType, IModelMemberViewItem info) : base(objectType, info) { } ... }

                                    2.2. Specify a property editor type by applying the DevExpress.ExpressApp.Model.ModelDefault attribute to a property and refer to the model property mentioned in (1.2). For example, [ModelDefault("PropertyEditorType", "<FullEditorTypeName>")]. This approach is only useful for platform-agnostic property editors or classes declared in platform-specific modules, because the exact type name is used.

                                    [C#]
                                    //Class declared in a WinForms module, for example public class BusinessObject : BaseObject { ... [ModelDefault("PropertyEditorType", "SampleSolution.Module.Win.PropertyEditors.CustomStringEditor")] public string Description { get { return GetPropertyValue<string>("Description"); } set { SetPropertyValue<string>("Description", value); } } }

                                    2.3. Specify a property editor alias by applying the DevExpress.Persistent.Base.EditorAlias attribute to a property. This approach allows you to automatically select an appropriate platform-specific editor associated with an alias depending on the application platform. All built-in property editors have aliases declared in the DevExpress.ExpressApp.Editors.EditorAliases enumeration. For custom editors, an alias can be specified in the PropertyEditor attribute applied to the editor class.

                                    [C#]
                                    public class BusinessObject : BaseObject { ... [EditorAlias("CustomStringEdit")] public string Description { get { return GetPropertyValue<string>("Description"); } set { SetPropertyValue<string>("Description", value); } } }
                                    [C#]
                                    [PropertyEditor(typeof(String), "CustomStringEdit", false)] public class CustomStringEditor : StringPropertyEditor { public CustomStringEditor(Type objectType, IModelMemberViewItem info) : base(objectType, info) { } ... }

                                0 Solutions

                                Creation Date Rating Importance Sort by

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2017 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners