Example #1
0
        public ActionResult Report4ExportToExcel()
        {
            var gridModel = new Report4Grid();

            SetupReport4Grid(gridModel.ReportGrid);
            JQGridState gridState = Session["Report4GridState"] as JQGridState;

            gridModel.ReportGrid.ExportToExcel(GetReport4Data(), "验收货物情况报表.xls", gridState);
            return(View());
        }
Example #2
0
        public JsonResult EnlazarDatos()
        {
            var datosGrid = ObtenerDatos();

            IJQGridModel gridModel = ArmarGrid();

            JQGridState gridState = gridModel.Grid.GetState();

            Session["GridState"] = gridState;

            return(gridModel.Grid.DataBind(datosGrid));
        }
        // This method is called when the grid requests data
        public JsonResult PerformanceLinqSearch_DataRequested()
        {
            // Get both the grid Model and the data Model
            // The data model in our case is an autogenerated linq2sql database based on Northwind.
            var context        = new Order11();
            var northWindModel = new OrderContext();

            SetUpGrid(context.OrdersGrid);

            JQGridState gridState = context.OrdersGrid.GetState();

            Session["gridState"] = gridState;
            // return the result of the DataBind method, passing the datasource as a parameter
            // jqGrid for ASP.NET MVC automatically takes care of paging, sorting, filtering/searching, etc

            return(context.OrdersGrid.DataBind(northWindModel.Orders));
        }