Skip to content

Grid WidthAttribute [Columns]

Victor Tomaili edited this page May 3, 2021 · 1 revision

[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; }

        [...]
Clone this wiki locally