Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
  • The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.
  • The page you are viewing does not exist in the .NET Core 3.0+ platform documentation. This link will take you to the parent topic of the current section.

ASPxPropertyEditor Class

The base class for Property Editors that use controls inherited from ASPxEditBase.

Namespace: DevExpress.ExpressApp.Web.Editors.ASPx

Assembly: DevExpress.ExpressApp.Web.v19.2.dll

Declaration

public abstract class ASPxPropertyEditor :
    WebPropertyEditor,
    ITestable

Remarks

ASPxPropertyEditor is a base class for custom Property Editors that use controls derived from ASPxEditBase. To use another control, inherit WebPropertyEditor instead.

The ASPxPropertyEditor class extends the WebPropertyEditor class functionality:

  • The ASPxPropertyEditor class provides the default implementation of the ReadEditModeValueCore and GetControlValueCore methods. These methods imply that all the controls have the Value property of the object type.
  • The ASPxEditor protected property is introduced. It returns a DevExpress.Web.ASPxEditors.ASPxEditBase object that is the Property Editor’s control used in edit mode.
  • The SetImmediatePostDataScript method is overridden to support the ImmediatePostData functionality.
  • The SetProcessValueChangedScript method is overridden to support the ConfirmUnsavedChanges mode.
  • The ValidationExpression and ErrorText properties are set depending on the EditMask value.
  • The ApplyReadOnly method is overridden to set the ClientEnabled and ReadOnly properties, depending on the ASPxPropertyEditor.AllowEdit property value.

To create a minimal property editor inherited from the ASPxPropertyEditor class, implement the CreateEditModeControlCore method. It’s required to subscribe to the control’s ValueChanged event to call the EditValueChangedHandler method (raises the PropertyEditor.ControlValueChanged event and calls the PropertyEditor.WriteValue method). To instantiate ASP.NET Web controls, use static helper methods of the RenderHelper class.

protected override WebControl CreateEditModeControlCore() {
  ASPxSpinEdit spinEdit = RenderHelper.CreateASPxSpinEdit();
  // Setup 'editModeControl' here.
  spinEdit.NumberChanged += EditValueChangedHandler;
  return spinEdit;
}

Refer to the WebPropertyEditor Class topic for details on creating custom Property Editors.

Note

  • All built-in XAF ASP.NET Property Editors inherit ASPxPropertyEditor.
  • A custom Property Editor that derives from the ASPxPropertyEditor should not throw exceptions. These exceptions interrupt the request processing. As a result, the application crashes.

Examples of Property Editors derived from ASPxPropertyEditor:

See Also