Exemple #1
0
        /// <summary>
        /// Grids the specified helper.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="helper">The helper.</param>
        /// <param name="collection">The collection.</param>
        /// <returns></returns>
        public static string Grid <T>(this HtmlHelper helper, List <T> collection)
        {
            List <string> columns = GetColumns <T>();
            GridTable <T> table   = new GridTable <T>(collection, () => columns, GetRow, string.Empty, string.Empty);

            return(table.CreateTable());
        }
Exemple #2
0
        /// <summary>
        /// Grids the specified helper.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="helper">The helper.</param>
        /// <param name="collection">The collection.</param>
        /// <param name="columns">The columns.</param>
        /// <param name="row">The row.</param>
        /// <param name="cssClass">The CSS class.</param>
        /// <param name="id">The id.</param>
        /// <param name="emptyTableMessage">The empty table message.</param>
        /// <param name="altRowCss">The alt row CSS.</param>
        /// <returns></returns>
        public static string Grid <T>(this HtmlHelper helper, List <T> collection, Func <List <string> > columns, Func <T, List <string> > row, string cssClass, string id, string emptyTableMessage, string altRowCss)
        {
            GridTable <T> table = new GridTable <T>(collection, columns, row, cssClass, id)
            {
                AlternateRowCssClass = altRowCss
            };

            return(table.CreateTable(emptyTableMessage));
        }
Exemple #3
0
        /// <summary>
        /// Grids the specified helper.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="helper">The helper.</param>
        /// <param name="collection">The collection.</param>
        /// <param name="columns">The columns.</param>
        /// <param name="row">The row.</param>
        /// <param name="cssClass">The CSS class.</param>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        public static string Grid <T>(this HtmlHelper helper, List <T> collection, Func <List <string> > columns, Func <T, List <string> > row, string cssClass, string id)
        {
            GridTable <T> table = new GridTable <T>(collection, columns, row, cssClass, id);

            return(table.CreateTable());
        }