Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

EditorAliasAttribute Class

Specifies the Property Editor alias.

Namespace: DevExpress.Persistent.Base

Assembly: DevExpress.ExpressApp.v19.2.dll

Declaration

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public class EditorAliasAttribute :
    Attribute
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public class EditorAliasAttribute :
    Attribute

Remarks

To assign a property editor to a specific business class’ property, you can use the IModelCommonMemberViewItem.PropertyEditorType property of the BOModel | <Class> | OwnMembers | <Member> node in the Model Editor. Most Property Editors are platform-specific, and you cannot specify the editor type in the common module. If you create a custom Property Editor that has the WinForms and ASP.NET versions, you will have to enable it for each platform individually.

However, you can assign the same string alias for both WinForms and ASP.NET editors, and use this alias to refer to your editor in a platform-independent manner. To assign an alias, you can use the PropertyEditorAttribute constructor that takes the alias parameter.

WinForms

using DevExpress.ExpressApp.Editors;
using DevExpress.ExpressApp.Win.Editors;
// ...
[PropertyEditor(typeof(string), "MyObjectPropertyEditorAlias", false)]
public class MyWinStringPropertyEditor : StringPropertyEditor {
    // ...
}

ASP.NET

using DevExpress.ExpressApp.Editors;
using DevExpress.ExpressApp.Web.Editors.ASPx;
// ...
[PropertyEditor(typeof(string), "MyStringPropertyEditorAlias", false)]
public class MyWebStringPropertyEditor : ASPxStringPropertyEditor {
    // ...
}

Now, you can pass “MyStringPropertyEditorAlias” to the EditorAliasAttribute to specify the property editor type of your business object in code without the use of the Model Editor.

If this attribute is applied to a property, then the property editor associated with the specified alias will be used for this property.

[EditorAlias("MyStringPropertyEditorAlias")]
public string SimpleProperty { get; set; }

If this attribute is applied to a business class, then the property editor associated with the specified alias will be used for all reference properties of the target type.

[EditorAlias("MyObjectPropertyEditorAlias")]
public class MyBusinessObject { 
    //...
}

Inheritance

Object
Attribute
EditorAliasAttribute
See Also