Ticket Q425458
Visible to All Users

Change Font Family and Size for All DevExpress.ExpressApp.Web.Editors.ASPx.ASPxStringPropertyEditor Controls

created 13 years ago

What is the easiest way to globally change the font size and family for all DevExpress.ExpressApp.Web.Editors.ASPx.ASPxStringPropertyEditor Controls at once, either in code or the model editor?

Comments (1)

    Would it be Appropriate to use the Conditional Appearance Module for this?

    Answers

    created 13 years ago

    I found the solution for my last comment.

    C#
    using System; using System.Web.UI.WebControls; using DevExpress.ExpressApp.Editors; using DevExpress.ExpressApp.Model; using DevExpress.ExpressApp.Web.Editors.ASPx; namespace ProcessAudits_1_0_10.Module.Web.Editors { [PropertyEditor(typeof(String), true)] class HTMLStringViewer: ASPxStringPropertyEditor { public HTMLStringViewer(Type objectType, IModelMemberViewItem model) : base(objectType, model) { } protected override object CreateControlCore() { WebControl editor = (WebControl)base.CreateControlCore(); editor.ControlStyle.Font.Size = 10; return editor; } } }

      created 13 years ago (modified 13 years ago)

      Hello Larry,
      You can accomplish this task via the custom property editor, as shown below:

      C#
      [PropertyEditor(typeof(String), true)] public class MyStringPropertyEditor : ASPxStringPropertyEditor { public MyStringPropertyEditor(Type objectType, IModelMemberViewItem model) : base(objectType, model) { } protected override WebControl CreateEditModeControlCore() { ASPxEditBase editor = (ASPxEditBase)base.CreateEditModeControlCore(); editor.ControlStyle.Font.Size = 20; return editor; } }

      The Conditional Appearance module can be also used for this - see How to: Handle Appearance Customizations.

        Comments (1)

          This solution works perfectly for edit mode. Can yo show me how to apply this same approach for changing the font style for the same content in non-edit mode?

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.