Search This Blog

Thursday, September 7, 2017

Minor improvements to the Web editors for image and reference properties

Starting with version 17.1.6, we simplified access to the internal upload control of the ASPxImagePropertyEditor, because several users wanted to tweak it. Here is the KB Article showing how to access ASPxImagePropertyEditor's ASPxUploadControl and customize it to set the maximum file size and allowed file extensions for the uploaded images:






Starting with version 17.1.6, we added the static DefaultViewModeBehavior property and the ViewModeBehavior property to the ASPxObjectPropertyEditorBase class (the base class for ASPxLookupPropertyEditor and ASPxObjectPropertyEditor used for reference properties).

To globally disable or show links, we recommend using the static ASPxObjectPropertyEditorBase.DefaultViewModeBehavior property instead of the former ASPxObjectPropertyEditorBase.ShowLink property. For instance, you can do this in the YourSolutionName.Web/Global.asax.xx or WebApplication.xx files:

static MainDemoWebApplication() {
            DevExpress.ExpressApp.Web.Editors.ASPx.ASPxObjectPropertyEditorBase.DefaultViewModeBehavior 
                = DevExpress.ExpressApp.Web.Editors.ASPx.ObjectPropertyEditorViewModeBehavior.ShowLabel;

If it is necessary to disable or show links in a specific situation, you no longer need to inherit a custom property editor from ASPxLookupPropertyEditor; just get access to the required PropertyEditor (see Access Editor Settings) and set the ViewModeBehavior property to the ShowLabel or ShowLink value. 


No comments:

Post a Comment