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?
Change Font Family and Size for All DevExpress.ExpressApp.Web.Editors.ASPx.ASPxStringPropertyEditor Controls
Answers
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;
}
}
}
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.
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?
Would it be Appropriate to use the Conditional Appearance Module for this?