FormWidthAttribute class

namespace: Serenity.ComponentModel   assemblySerenity.Net.Core

Sets CSS class for field on forms only. Useful for Bootstrap grid, e.g. col-md-4 etc.

[AttributeUsage(AttributeTargets.All)]
public class FormWidthAttribute : Attribute

Public Members

name description
FormWidthAttribute() Creates a FormWidth attribute with no initial column classes. Make sure to set properties to make it useful.
FormWidthAttribute(…) Creates a FormWidth attribute with given custom css class, like col-md-6 col-sm-4 etc.
JustThis { get; set; } Applies this form width (e.g. bootstrap grid size) to just current field and doesn't cancel prior form width attribute with a UntilNext attribute. Don't set UntilNext = true if you set JustThis = true, as they are exclusive
Large { get; set; } Gets / sets cols (1..12) in large devices (width >= 1200px, large desktops)
Medium { get; set; } Gets / sets cols (1..12) in medium devices (width >= 992px, medium desktops)
Small { get; set; } Gets / sets cols (1..12) in small devices (width >= 768px, tablets)
UntilNext { get; set; } Applies this form width (e.g. bootstrap grid size) to all following fields until next another FormWidth attribute
Value { get; protected set; } Gets the css class that will be applied to field
XSmall { get; set; } Gets / sets cols (1..12) in extra small devices (width < 768px, mobile phones)

See Also