ComponentOne ASP.NET MVC Controls
AutoGridLayout Class
Members  Example 

C1.Web.Mvc Namespace : AutoGridLayout Class
Defines a class represents the auto grid layout, in which the tiles render one by one without overlapping.
Syntax
'Declaration
 
Public Class AutoGridLayout 
   Inherits GridLayout
   Implements ITemplate 
public class AutoGridLayout : GridLayout, ITemplate  
Remarks

The AutoGridLayout class is used to define the AutoGridLayout for the DashboardLayout control,  in which the tiles render one by one without overlapping. The following options for the layout can be set using the properties of this class:


1. The layout orientation can be set to horizontal or vertical using the Orientation property.


2. The groups which are of type AutoGridGroup class, are added using the Add method of the ListItemFactory class and can be retrieved using the Items property of this class.


3. Each group is split into multiple rows and columns based on the value set for the MaxRowOrColumns property.


4. The CellSize property is used to define the size of the cells, while the CellSpacing and GroupSpacing properties are used to define space between the cells in each group and the space between the groups respectively.

Example
@(Html.C1().DashboardLayout()
         .AttachAutoGridLayout(mglb => mglb.Orientation(LayoutOrientation.Vertical)
             .MaxRowsOrColumns(3)
             .CellSize(303)
             .Items(isb =>
             {
                 isb.Add().Children(cb =>
                 {
                     cb.Add().HeaderText(""Category Sales"")
                         .Content(""#CategorySales"")
                         .RowSpan(1).ColumnSpan(1);
                     cb.Add().HeaderText(""Products Stock"")
                         .Content(""#ProductsStock"")
                         .RowSpan(1).ColumnSpan(1);
                 });
                 isb.Add().Children(cb =>
                 {
                     cb.Add().HeaderText(""Product Details"")
                        .Content(""#ProductDetails"")
                        .RowSpan(1).ColumnSpan(2);
                 });
             })))
Inheritance Hierarchy

System.Object
   C1.Web.Mvc.Component
         C1.Web.Mvc.LayoutBase
            C1.Web.Mvc.GridLayout
               C1.Web.Mvc.AutoGridLayout

See Also

Reference

AutoGridLayout Members
C1.Web.Mvc Namespace