Ejemplo n.º 1
0
        public GridModel(IQueryable <T> source, ViewDataDictionary viewData, ViewContext viewContext, ControllerContext controllerContext, TempDataDictionary tempData = null)
        {
            source_      = source;
            tempData_    = tempData;
            Context      = controllerContext;
            viewContext_ = viewContext;
            ViewData     = viewData;
            GridType     = typeof(T);
            Ordering     = new Ordering(Context.HttpContext.Request.QueryString[GridParameters.OrderKey], GridType);
            Pagination   = new Pagination <T>(source_, this);

            ColumnList    = new List <GridColumnBase <T> >();
            HiddenColumns = new List <GridColumnBase <T> >();
            DataKeys      = new List <IGridDataKey <T> >();

            Width         = GridParameters.GridDefaultWidth;
            ToolBar       = new GridToolBar <T>(this);
            ViewModelType = viewData.Model != null?viewData.Model.GetType() : null;

            FormAction          = Context.HttpContext.Request.RawUrl;
            HasModelStateErrors = viewData.HasModelStateErrors();
            HasForm             = true;
        }
Ejemplo n.º 2
0
 public ToolBarRenderer(GridToolBar <T> toolBar, int colspan)
 {
     gridToolBar_ = toolBar;
     colspan_     = colspan;
 }
Ejemplo n.º 3
0
 public GridToolBarCommandFactory(GridToolBar <T> toolBar, ControllerContext context)
 {
     Context = context;
     ToolBar = toolBar;
 }