WidthAttribute [Columns]

Estrusco edited this page Oct 27, 2016 · 1 revision
Clone this wiki locally

[namespace: Serenity.ComponentModel] - [assembly: Serenity.Core]

This attribute can be used on a column field to specify the width of the column. Is also possible specify a max and min value for the width.

Attribute definition:

    public class WidthAttribute : Attribute
    {
        public WidthAttribute(int value);

        public int Max { get; set; }
        public int Min { get; set; }
        public int Value { get; }
    }

Use

    public class ProductColumns
    {
        [Width(150)]
        public String ProductID { get; set; }
        [Width(250, Max = 400, Min = 150)]
        public String ProductName { get; set; }

        [...]