Exemplo n.º 1
0
        public IGridWithOptions <T> Columns(Action <ColumnBuilder <T> > columnBuilder)
        {
            var builder = new ColumnBuilder <T>();

            columnBuilder(builder);

            foreach (var column in builder)
            {
                _gridModel.Columns.Add(column);
                if (column.IsSortable)
                {
                    _isGridRenderedWithSorting = true;
                }
            }

            return(this);
        }
Exemplo n.º 2
0
        public IGridWithOptions <T> Columns(Action <ColumnBuilder <T> > columnBuilder)
        {
            var builder = new ColumnBuilder <T>();

            columnBuilder(builder);

            foreach (var column in builder)
            {
                if (column.Position == null)
                {
                    _gridModel.Columns.Add(column);
                }
                else
                {
                    _gridModel.Columns.Insert(column.Position.Value, column);
                }
            }

            return(this);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a new instance of the GridModel class
 /// </summary>
 public GridModel()
 {
     _emptyText     = "There is no data available.";
     _columnBuilder = CreateColumnBuilder();
 }