Episerver 9 - how to change the style of textbox fields in edit mode



In Episerver 7.5, we used the following code to make certain fields wider:

[EditorDescriptorRegistration(TargetType = typeof(string), UIHint = UiHint)]
public class WideTextboxEditorDescriptor : EditorDescriptor
    public const string UiHint = "WideTextbox";

    public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable attributes)
        base.ModifyMetadata(metadata, attributes);
        metadata.EditorConfiguration.Add("style", "width: 600px");

This code doesn't work in Episerver 9.8

What should be used instead?


Apr 28, 2016 12:26


Add EditorDescriptorBehavior = EditorDescriptorBehavior.ExtendBase to you EditorDescriptorRegistration

[EditorDescriptorRegistration(EditorDescriptorBehavior = EditorDescriptorBehavior.ExtendBase, TargetType = typeof(string), UIHint = UiHint)]


May 01, 2016 1:47
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.