private GridModel GridLoadOnDemandModel()
        {
            GridModel grid = new GridModel();
            grid.AutoGenerateLayouts = false;
            grid.AutoGenerateColumns = true;
            grid.PrimaryKey = "ID";
            grid.Width = "100%";
            grid.Columns.Add(new GridColumn() { HeaderText = "Service ID", Key = "ID", DataType = "number" });
            grid.Columns.Add(new GridColumn() { HeaderText = "Client ID", Key = "ClientID", DataType = "number" });
            grid.Columns.Add(new GridColumn() { HeaderText = "Package ID", Key = "PackageID", DataType = "number" });

            GridColumnLayoutModel layout = new GridColumnLayoutModel();
            layout.Key = "ServiceHistory";
            layout.ForeignKey = "ID";
            layout.PrimaryKey = "ID";
            layout.AutoGenerateColumns = false;
            layout.Columns.Add(new GridColumn() { HeaderText = "Log ID", Key = "LogID", DataType = "number", Hidden = true });
            layout.Columns.Add(new GridColumn() { HeaderText = "Service ID", Key = "ID", DataType = "number", Hidden = true});
            layout.Columns.Add(new GridColumn() { HeaderText = "Client ID", Key = "ClientID", DataType = "number" });
            layout.Columns.Add(new GridColumn() { HeaderText = "Package ID", Key = "PackageID", DataType = "number" });

            layout.Width = "100%";
            grid.ColumnLayouts.Add(layout);

            return grid;
        }
        private GridColumnLayoutModel GetProductsLayout()
        {
            GridColumnLayoutModel layout = new GridColumnLayoutModel();

            layout.Key                 = "Products";
            layout.PrimaryKey          = "ID";
            layout.ForeignKey          = "CategoryID";
            layout.Width               = "100%";
            layout.AutoGenerateColumns = false;
            //layout.AutofitLastColumn = false;
            layout.Columns = new List <GridColumn>();
            layout.Columns.Add(new GridColumn()
            {
                HeaderText = "Product ID", Key = "ID", DataType = "number", Width = "15%"
            });
            layout.Columns.Add(new GridColumn()
            {
                HeaderText = "Product Name", Key = "ProductName", DataType = "string", Width = "20%"
            });
            layout.Columns.Add(new GridColumn()
            {
                HeaderText = "Unit Price", Key = "UnitPrice", DataType = "number", Width = "15%"
            });
            layout.Columns.Add(new GridColumn()
            {
                HeaderText = "Units In Stock", Key = "UnitsInStock", DataType = "number", Width = "15%"
            });
            layout.Columns.Add(new GridColumn()
            {
                HeaderText = "Category ID", Key = "CategoryID", DataType = "number", Width = "0%", Hidden = true
            });
            layout.Columns.Add(new GridColumn()
            {
                HeaderText = "Discontinued", Key = "Discontinued", DataType = "bool", Width = "15%"
            });
            layout.DataSourceUrl = this.Url.Action("GetProductsData");
            layout.Features.Add(new GridResponsive()
            {
                EnableVerticalRendering = false,
                ColumnSettings          = new List <ResponsiveColumnSetting>()
                {
                    new ResponsiveColumnSetting()
                    {
                        ColumnKey = "ID", Classes = "ui-hidden-phone ui-hidden-tablet"
                    },
                    new ResponsiveColumnSetting()
                    {
                        ColumnKey = "UnitsInStock", Classes = "ui-hidden-phone ui-hidden-tablet"
                    },
                    new ResponsiveColumnSetting()
                    {
                        ColumnKey = "UnitPrice", Classes = "ui-hidden-phone ui-hidden-tablet"
                    }
                }
            });
            return(layout);
        }
        private GridModel GridLoadOnDemandModel()
        {
            // Define the Categories layout
            GridModel grid = new GridModel();

            grid.AutoGenerateLayouts = false;
            grid.AutoGenerateColumns = false;
            grid.PrimaryKey          = "ID";
            grid.Width = "100%";
            grid.Columns.Add(new GridColumn()
            {
                HeaderText = "Category ID", Key = "ID", DataType = "number", Width = "0%", Hidden = true
            });
            grid.Columns.Add(new GridColumn()
            {
                HeaderText = "Category Name", Key = "CategoryName", DataType = "string", Width = "30%"
            });
            grid.Columns.Add(new GridColumn()
            {
                HeaderText = "Description", Key = "Description", DataType = "string", Width = "50%"
            });
            grid.Columns.Add(new GridColumn()
            {
                HeaderText = "Products Count", Key = "ProductCount", DataType = "number", Width = "20%"
            });

            // Define the Products layout
            GridColumnLayoutModel layout = new GridColumnLayoutModel();

            layout.Key                 = "Products";
            layout.ForeignKey          = "CategoryID";
            layout.PrimaryKey          = "ID";
            layout.AutoGenerateColumns = false;
            layout.Columns.Add(new GridColumn()
            {
                HeaderText = "Product ID", Key = "ID", DataType = "number", Width = "0%", Hidden = true
            });
            layout.Columns.Add(new GridColumn()
            {
                HeaderText = "Category ID", Key = "CategoryID", DataType = "number", Width = "0%", Hidden = true
            });
            layout.Columns.Add(new GridColumn()
            {
                HeaderText = "Product Name", Key = "ProductName", DataType = "string", Width = "40%"
            });
            layout.Columns.Add(new GridColumn()
            {
                HeaderText = "Unit Price", Key = "UnitPrice", DataType = "number", Width = "30%"
            });
            layout.Columns.Add(new GridColumn()
            {
                HeaderText = "Units In Stock", Key = "UnitsInStock", DataType = "number", Width = "30%"
            });

            layout.Width = "100%";
            grid.ColumnLayouts.Add(layout);

            GridPaging paging = new GridPaging();

            paging.Type     = OpType.Remote;
            paging.Inherit  = true;
            paging.PageSize = 5;
            grid.Features.Add(paging);

            return(grid);
        }
        private GridModel GetGridModel()
        {
            GridModel gridModel = new GridModel();

            gridModel.ID = "gridModel";
            gridModel.AutoGenerateColumns = false;
            gridModel.AutoGenerateLayouts = false;
            gridModel.PrimaryKey          = "ID";
            gridModel.LoadOnDemand        = false;
            gridModel.Width   = "100%";
            gridModel.Columns = new List <GridColumn>();
            gridModel.Columns.Add(new GridColumn()
            {
                HeaderText = "Category ID", Key = "ID", DataType = "number", Width = "15%"
            });
            gridModel.Columns.Add(new GridColumn()
            {
                HeaderText = "Category Name", Key = "CategoryName", DataType = "string", Width = "30%"
            });
            gridModel.Columns.Add(new GridColumn()
            {
                HeaderText = "Description", Key = "Description", DataType = "string", Width = "40%"
            });
            gridModel.Columns.Add(new GridColumn()
            {
                HeaderText = "Products Count", Key = "ProductCount", DataType = "number", Width = "15%"
            });

            gridModel.DataSourceUrl = this.Url.Action("GetCategoriesData");
            gridModel.DataSource    = RepositoryFactory.GetCategoryRepository(IncludeChildren.Products).Get().AsQueryable();

            GridColumnLayoutModel productsModel = GetProductsLayout();

            gridModel.ColumnLayouts.Add(productsModel);

            gridModel.Features.Add(new GridFiltering()
            {
                Type = OpType.Remote, Inherit = true, Persist = false
            });
            gridModel.Features.Add(new GridSorting()
            {
                Type = OpType.Remote, Inherit = true, Persist = false
            });
            gridModel.Features.Add(new GridSummaries()
            {
                Type = OpType.Remote, Inherit = true
            });
            gridModel.Features.Add(new GridPaging()
            {
                Type = OpType.Remote, Inherit = true, PageSize = 5
            });
            gridModel.Features.Add(new GridResponsive()
            {
                EnableVerticalRendering = false,
                ColumnSettings          = new List <ResponsiveColumnSetting>()
                {
                    new ResponsiveColumnSetting()
                    {
                        ColumnKey = "ID", Classes = "ui-hidden-phone"
                    },
                    new ResponsiveColumnSetting()
                    {
                        ColumnKey = "Description", Classes = "ui-hidden-phone"
                    }
                }
            });

            return(gridModel);
        }
        public ActionResult Index(string returnUrl)
        {
            ViewBag.ReturnUrl = returnUrl;
            //data.projects = data.projects.OrderBy(project => project.status).ThenBy(project => project.project_id).ToList();

            string    pID      = data.projects[0].project_id.ToString(); // Obtain 1st Project ID
            GridModel overview = new GridModel();

            overview.DataSource = data.resourceOverview[pID].weeks[0].resources.AsQueryable();

            overview.ID                  = "resource-overview-table";
            overview.PrimaryKey          = "employeedID";
            overview.Width               = "100%";
            overview.AutoGenerateColumns = false;
            overview.AutoGenerateLayouts = false;
            overview.EnableHoverStyles   = false;
            overview.AutofitLastColumn   = false;

            GridColumn employeeIDCol = new GridColumn();

            employeeIDCol.Key        = "employeeID";
            employeeIDCol.HeaderText = "Employee ID";
            employeeIDCol.DataType   = "string";
            employeeIDCol.Hidden     = true;

            GridColumn disciplineCol = new GridColumn();

            disciplineCol.Key               = "discipline";
            disciplineCol.HeaderText        = "Discipline";
            disciplineCol.DataType          = "string";
            disciplineCol.Width             = "113px";
            disciplineCol.HeaderCssClass    = "disciplineCol";
            disciplineCol.ColumnCssClass    = "disciplineCol";
            disciplineCol.FormatterFunction = "formatResourceFirstCol";

            overview.Columns.Add(employeeIDCol);
            overview.Columns.Add(disciplineCol);

            int      wk = 1;
            int      compareWithStartDate, compareWithEndDate;
            string   today = "2015-07-07 12:00:00";
            DateTime t1 = Convert.ToDateTime(today);
            DateTime sdate, edate;
            string   sdateMonth, edateMonth, sdateDay, edateDay, curLabel;

            curLabel = @Resources.Main.Overview_CurrentLabel;
            foreach (var week in data.resourceOverview[pID].weeks)
            {
                sdate = Convert.ToDateTime(week.startDate);
                edate = Convert.ToDateTime(week.endDate);
                compareWithStartDate = DateTime.Compare(t1, sdate);
                compareWithEndDate   = DateTime.Compare(t1, edate);

                sdateMonth = week.startDate.Substring(5, 2).TrimStart(new Char[] { '0' });
                sdateDay   = week.startDate.Substring(8, 2).TrimStart(new Char[] { '0' });
                edateMonth = week.endDate.Substring(5, 2).TrimStart(new Char[] { '0' });
                edateDay   = week.endDate.Substring(8, 2).TrimStart(new Char[] { '0' });
                GridColumn weekCol = new GridColumn();
                weekCol.Key = "discipline";
                if (compareWithStartDate > 0 && compareWithEndDate < 0)
                {
                    weekCol.HeaderText = @"<div class='igColHeader current' data-week='" + wk + "' data-week-end='" + week.endDate + "' data-week-start='" + week.startDate + "'>" + sdateMonth + "/" + sdateDay + "-" + edateMonth + "/" + edateDay + " <small style='color: #fff;'>(" + curLabel + ")</small></div>";
                }
                else
                {
                    weekCol.HeaderText = @"<div class='igColHeader' data-week='" + wk + "' data-week-end='" + week.endDate + "' data-week-start='" + week.startDate + "'>" + sdateMonth + "/" + sdateDay + "-" + edateMonth + "/" + edateDay + "</div>";
                }
                weekCol.DataType       = "string";
                weekCol.Width          = "113px";
                weekCol.ColumnCssClass = "gaugeRow";
                weekCol.Template       = @"<div class='hidden notification overage'></div><div class='linear-gauge week" + wk + "' data-week='" + wk + "'></div>";

                overview.Columns.Add(weekCol);

                wk = wk + 1;
            }
            overview.AddClientEvent("rowsRendered", "app.utils.renderLinearGauge(resourceOverview['10000'])");



            GridModel tasks = new GridModel();

            tasks.DataSource = data.taskList[pID].tasks.AsQueryable();

            tasks.ID                  = "project-tasks-table";
            tasks.PrimaryKey          = "id";
            tasks.AutoGenerateColumns = false;
            tasks.AlternateRowStyles  = false;
            tasks.EnableHoverStyles   = true;
            tasks.ShowHeader          = false;


            GridColumn taskIDCol = new GridColumn();

            taskIDCol.Key        = "id";
            taskIDCol.HeaderText = "Task ID";
            taskIDCol.DataType   = "number";
            taskIDCol.Hidden     = true;

            GridColumn taskCol = new GridColumn();

            taskCol.Key               = "name";
            taskCol.HeaderText        = "Task";
            taskCol.DataType          = "string";
            taskCol.FormatterFunction = @"function(v,r) { return ""<div class='taskItem' data-task-end='"" + r.endDate + ""' data-task-start='"" + r.startDate + ""'><span class='taskname "" + r.flag + ""' data-category='"" + r.discipline.toLowerCase().replace(' ', '-') + ""'>"" + v + "" <small>(# "" + r.id + "")</small></span><span class='enddate'>"" + Resources.TaskProjectedEndLabel + "" "" + (parseDate(r.endDate).getMonth()+1) + '/' + parseDate(r.endDate).getDate() + ""</span><span class='hours'>"" + r.hours +  "" <span class='visible-lg-inline'>"" + Resources.TaskHoursLabel + ""</span><span class='visible-md-inline visible-sm-inline visible-xs-inline'>"" + Resources.TaskHrsLabel + ""</span></span></div>""; }";

            GridColumn flagCol = new GridColumn();

            flagCol.Key        = "flag";
            flagCol.HeaderText = "Flag";
            flagCol.DataType   = "string";
            flagCol.Hidden     = true;

            GridColumn discCol = new GridColumn();

            discCol.Key        = "discipline";
            discCol.HeaderText = "Discipline";
            discCol.DataType   = "string";
            discCol.Hidden     = true;

            GridColumn edateCol = new GridColumn();

            edateCol.Key        = "endDate";
            edateCol.HeaderText = "End Date";
            edateCol.DataType   = "string";
            edateCol.Hidden     = true;

            GridColumn sdateCol = new GridColumn();

            sdateCol.Key        = "startDate";
            sdateCol.HeaderText = "Start Date";
            sdateCol.DataType   = "string";
            sdateCol.Hidden     = true;

            GridColumn hoursCol = new GridColumn();

            hoursCol.Key        = "hours";
            hoursCol.HeaderText = "hours";
            hoursCol.DataType   = "string";
            hoursCol.Hidden     = true;

            /*Add Columns*/
            tasks.Columns.Add(taskIDCol);
            tasks.Columns.Add(taskCol);
            tasks.Columns.Add(flagCol);
            tasks.Columns.Add(discCol);
            tasks.Columns.Add(edateCol);
            tasks.Columns.Add(sdateCol);
            tasks.Columns.Add(hoursCol);

            GridColumnLayoutModel layout = new GridColumnLayoutModel();

            layout.Key = "assets";
            layout.AutoGenerateColumns = false;
            layout.EnableHoverStyles   = false;
            layout.ShowHeader          = false;

            GridColumn type = new GridColumn();

            type.Key               = "type";
            type.HeaderText        = "Type";
            type.DataType          = "string";
            type.ColumnCssClass    = "file-type";
            type.FormatterFunction = @"function(val){return ""<i class='icon-sm icon-"" + val + ""'></i>"";}";

            GridColumn name = new GridColumn();

            name.Key            = "name";
            name.HeaderText     = "Assets";
            name.DataType       = "string";
            name.ColumnCssClass = "task-name";

            GridColumn url = new GridColumn();

            url.Key               = "url";
            url.HeaderText        = "URL";
            url.DataType          = "string";
            url.FormatterFunction = @"function(val){return ""<small>(<a href='"" + val + ""' target='_blank'>"" + Resources.TaskViewFile + ""</a>)</small>"";}";

            layout.Columns.Add(type);
            layout.Columns.Add(name);
            layout.Columns.Add(url);


            tasks.ColumnLayouts.Add(layout);

            tasks.AddClientEvent("rowsRendered", "app.utils.taskListRowsRendered()");
            tasks.AddClientEvent("rowExpanding", "app.utils.taskListRowsExpanding(evt,ui)");


            dynamic vm = new ExpandoObject();

            vm.data  = data;
            vm.grid  = overview;
            vm.tasks = tasks;

            return(View(vm));
        }
        private GridModel GridLoadOnDemandModel()
        {
            // Define the Categories layout
            GridModel grid = new GridModel();
            grid.AutoGenerateLayouts = false;
            grid.AutoGenerateColumns = false;
            grid.PrimaryKey = "ID";
            grid.Width = "100%";
            grid.Columns.Add(new GridColumn() { HeaderText = "Category ID", Key = "ID", DataType = "number", Width = "0%", Hidden = true});
            grid.Columns.Add(new GridColumn() { HeaderText = "Category Name", Key = "CategoryName", DataType = "string", Width = "30%" });
            grid.Columns.Add(new GridColumn() { HeaderText = "Description", Key = "Description", DataType = "string", Width = "50%" });
            grid.Columns.Add(new GridColumn() { HeaderText = "Products Count", Key = "ProductCount", DataType = "number", Width = "20%" });

            // Define the Products layout
            GridColumnLayoutModel layout = new GridColumnLayoutModel();
            layout.Key = "Products";
            layout.ForeignKey = "CategoryID";
            layout.PrimaryKey = "ID";
            layout.AutoGenerateColumns = false;
            layout.Columns.Add(new GridColumn() { HeaderText = "Product ID", Key = "ID", DataType = "number", Width = "0%", Hidden = true });
            layout.Columns.Add(new GridColumn() { HeaderText = "Category ID", Key = "CategoryID", DataType = "number",Width = "0%", Hidden = true});
            layout.Columns.Add(new GridColumn() { HeaderText = "Product Name", Key = "ProductName", DataType = "string",Width = "40%"});
            layout.Columns.Add(new GridColumn() { HeaderText = "Unit Price", Key = "UnitPrice", DataType = "number", Width = "30%" });
            layout.Columns.Add(new GridColumn() { HeaderText = "Units In Stock", Key = "UnitsInStock", DataType = "number", Width = "30%" });

            layout.Width = "100%";
            grid.ColumnLayouts.Add(layout);

            GridPaging paging = new GridPaging();
            paging.Type = OpType.Remote;
            paging.Inherit = true;
            paging.PageSize = 5;
            grid.Features.Add(paging);

            return grid;
        }
 private GridColumnLayoutModel GetProductsLayout()
 {
     GridColumnLayoutModel layout = new GridColumnLayoutModel();
     layout.Key = "Products";
     layout.PrimaryKey = "ID";
     layout.ForeignKey = "CategoryID";
     layout.Width = "100%";
     layout.AutoGenerateColumns = false;
     //layout.AutofitLastColumn = false;
     layout.Columns = new List<GridColumn>();
     layout.Columns.Add(new GridColumn() { HeaderText = "Product ID", Key = "ID", DataType = "number", Width = "15%"});
     layout.Columns.Add(new GridColumn() { HeaderText = "Product Name", Key = "ProductName", DataType = "string", Width = "20%"});
     layout.Columns.Add(new GridColumn() { HeaderText = "Unit Price", Key = "UnitPrice", DataType = "number", Width = "15%"});
     layout.Columns.Add(new GridColumn() { HeaderText = "Units In Stock", Key = "UnitsInStock", DataType = "number", Width = "15%"});
     layout.Columns.Add(new GridColumn() { HeaderText = "Category ID", Key = "CategoryID", DataType = "number", Width = "0%", Hidden = true });
     layout.Columns.Add(new GridColumn() { HeaderText = "Discontinued", Key = "Discontinued", DataType = "bool", Width = "15%" });
     layout.DataSourceUrl = this.Url.Action("GetProductsData");
     layout.Features.Add(new GridResponsive()
     {
         EnableVerticalRendering = false,
         ColumnSettings = new List<ResponsiveColumnSetting>() {
             new ResponsiveColumnSetting() { ColumnKey = "ID", Classes = "ui-hidden-phone ui-hidden-tablet" },
             new ResponsiveColumnSetting() { ColumnKey = "UnitsInStock", Classes = "ui-hidden-phone ui-hidden-tablet" },
             new ResponsiveColumnSetting() { ColumnKey = "UnitPrice", Classes = "ui-hidden-phone ui-hidden-tablet" }
         }
     });
     return layout;
 }
        public ActionResult Index(string returnUrl)
        {
            ViewBag.ReturnUrl = returnUrl;
            //data.projects = data.projects.OrderBy(project => project.status).ThenBy(project => project.project_id).ToList();

            string pID = data.projects[0].project_id.ToString(); // Obtain 1st Project ID
            GridModel overview = new GridModel();
            overview.DataSource = data.resourceOverview[pID].weeks[0].resources.AsQueryable();

            overview.ID = "resource-overview-table";
            overview.PrimaryKey = "employeedID";
            overview.Width = "100%";
            overview.AutoGenerateColumns = false;
            overview.AutoGenerateLayouts = false;
            overview.EnableHoverStyles = false;
            overview.AutofitLastColumn = false;

            GridColumn employeeIDCol = new GridColumn();
            employeeIDCol.Key = "employeeID";
            employeeIDCol.HeaderText = "Employee ID";
            employeeIDCol.DataType = "string";
            employeeIDCol.Hidden = true;

            GridColumn disciplineCol = new GridColumn();
            disciplineCol.Key = "discipline";
            disciplineCol.HeaderText = "Discipline";
            disciplineCol.DataType = "string";
            disciplineCol.Width = "113px";
            disciplineCol.HeaderCssClass = "disciplineCol";
            disciplineCol.ColumnCssClass = "disciplineCol";
            disciplineCol.FormatterFunction = "formatResourceFirstCol";

            overview.Columns.Add(employeeIDCol);
            overview.Columns.Add(disciplineCol);

            int wk = 1;
            int compareWithStartDate, compareWithEndDate;
            string today = "2015-07-07 12:00:00";
            DateTime t1 = Convert.ToDateTime(today);
            DateTime sdate,edate;
            string sdateMonth, edateMonth, sdateDay, edateDay, curLabel;
            curLabel = @Resources.Main.Overview_CurrentLabel;
            foreach (var week in data.resourceOverview[pID].weeks)
            {

                sdate = Convert.ToDateTime(week.startDate);
                edate = Convert.ToDateTime(week.endDate);
                compareWithStartDate = DateTime.Compare(t1, sdate);
                compareWithEndDate = DateTime.Compare(t1, edate);

                sdateMonth = week.startDate.Substring(5, 2).TrimStart(new Char[] { '0' });
                sdateDay = week.startDate.Substring(8, 2).TrimStart(new Char[] { '0' });
                edateMonth = week.endDate.Substring(5, 2).TrimStart(new Char[] { '0' });
                edateDay = week.endDate.Substring(8, 2).TrimStart(new Char[] { '0' });
                GridColumn weekCol = new GridColumn();
                weekCol.Key = "discipline";
                if (compareWithStartDate > 0 && compareWithEndDate < 0) {
                    weekCol.HeaderText = @"<div class='igColHeader current' data-week='" + wk + "' data-week-end='" + week.endDate + "' data-week-start='" + week.startDate + "'>" + sdateMonth + "/" + sdateDay + "-" + edateMonth + "/" + edateDay + " <small style='color: #fff;'>(" + curLabel + ")</small></div>";
                }
                else
                {
                    weekCol.HeaderText = @"<div class='igColHeader' data-week='" + wk + "' data-week-end='" + week.endDate + "' data-week-start='" + week.startDate + "'>" + sdateMonth + "/" + sdateDay + "-" + edateMonth + "/" + edateDay + "</div>";
                }
                weekCol.DataType = "string";
                weekCol.Width = "113px";
                weekCol.ColumnCssClass = "gaugeRow";
                weekCol.Template = @"<div class='hidden notification overage'></div><div class='linear-gauge week" + wk + "' data-week='" + wk + "'></div>";

                overview.Columns.Add(weekCol);

                wk = wk + 1;
            }
            overview.AddClientEvent("rowsRendered", "app.utils.renderLinearGauge(resourceOverview['10000'])");

            GridModel tasks = new GridModel();
            tasks.DataSource = data.taskList[pID].tasks.AsQueryable();

            tasks.ID = "project-tasks-table";
            tasks.PrimaryKey = "id";
            tasks.AutoGenerateColumns = false;
            tasks.AlternateRowStyles = false;
            tasks.EnableHoverStyles = true;
            tasks.ShowHeader = false;

            GridColumn taskIDCol = new GridColumn();
            taskIDCol.Key = "id";
            taskIDCol.HeaderText = "Task ID";
            taskIDCol.DataType = "number";
            taskIDCol.Hidden = true;

            GridColumn taskCol = new GridColumn();
            taskCol.Key = "name";
            taskCol.HeaderText = "Task";
            taskCol.DataType = "string";
            taskCol.FormatterFunction = @"function(v,r) { return ""<div class='taskItem' data-task-end='"" + r.endDate + ""' data-task-start='"" + r.startDate + ""'><span class='taskname "" + r.flag + ""' data-category='"" + r.discipline.toLowerCase().replace(' ', '-') + ""'>"" + v + "" <small>(# "" + r.id + "")</small></span><span class='enddate'>"" + Resources.TaskProjectedEndLabel + "" "" + (parseDate(r.endDate).getMonth()+1) + '/' + parseDate(r.endDate).getDate() + ""</span><span class='hours'>"" + r.hours +  "" <span class='visible-lg-inline'>"" + Resources.TaskHoursLabel + ""</span><span class='visible-md-inline visible-sm-inline visible-xs-inline'>"" + Resources.TaskHrsLabel + ""</span></span></div>""; }";

            GridColumn flagCol = new GridColumn();
            flagCol.Key = "flag";
            flagCol.HeaderText = "Flag";
            flagCol.DataType = "string";
            flagCol.Hidden = true;

            GridColumn discCol = new GridColumn();
            discCol.Key = "discipline";
            discCol.HeaderText = "Discipline";
            discCol.DataType = "string";
            discCol.Hidden = true;

            GridColumn edateCol = new GridColumn();
            edateCol.Key = "endDate";
            edateCol.HeaderText = "End Date";
            edateCol.DataType = "string";
            edateCol.Hidden = true;

            GridColumn sdateCol = new GridColumn();
            sdateCol.Key = "startDate";
            sdateCol.HeaderText = "Start Date";
            sdateCol.DataType = "string";
            sdateCol.Hidden = true;

            GridColumn hoursCol = new GridColumn();
            hoursCol.Key = "hours";
            hoursCol.HeaderText = "hours";
            hoursCol.DataType = "string";
            hoursCol.Hidden = true;

            /*Add Columns*/
            tasks.Columns.Add(taskIDCol);
            tasks.Columns.Add(taskCol);
            tasks.Columns.Add(flagCol);
            tasks.Columns.Add(discCol);
            tasks.Columns.Add(edateCol);
            tasks.Columns.Add(sdateCol);
            tasks.Columns.Add(hoursCol);

            GridColumnLayoutModel layout = new GridColumnLayoutModel();
            layout.Key = "assets";
            layout.AutoGenerateColumns = false;
            layout.EnableHoverStyles = false;
            layout.ShowHeader = false;

            GridColumn type = new GridColumn();
            type.Key = "type";
            type.HeaderText = "Type";
            type.DataType = "string";
            type.ColumnCssClass = "file-type";
            type.FormatterFunction = @"function(val){return ""<i class='icon-sm icon-"" + val + ""'></i>"";}";

            GridColumn name = new GridColumn();
            name.Key = "name";
            name.HeaderText = "Assets";
            name.DataType = "string";
            name.ColumnCssClass = "task-name";

            GridColumn url = new GridColumn();
            url.Key = "url";
            url.HeaderText = "URL";
            url.DataType = "string";
            url.FormatterFunction = @"function(val){return ""<small>(<a href='"" + val + ""' target='_blank'>"" + Resources.TaskViewFile + ""</a>)</small>"";}";

            layout.Columns.Add(type);
            layout.Columns.Add(name);
            layout.Columns.Add(url);

            tasks.ColumnLayouts.Add(layout);

            tasks.AddClientEvent("rowsRendered", "app.utils.taskListRowsRendered()");
            tasks.AddClientEvent("rowExpanding", "app.utils.taskListRowsExpanding(evt,ui)");

            dynamic vm = new ExpandoObject();
            vm.data = data;
            vm.grid = overview;
            vm.tasks = tasks;

            return View(vm);
        }