public ActionResult ListarCreditosGrd(GridDataRequest request) { int totalRecords = 0; var lstGrd = CreditoBL.ListarCreditosGrd(request, ref totalRecords); var productsData = new { total = (int)Math.Ceiling((float)totalRecords / (float)request.rows), page = request.page, records = totalRecords, rows = (from item in lstGrd select new { id = item.CreditoId, cell = new string[] { item.CreditoId.ToString(), item.MontoProducto.ToString(), item.MontoInicial.ToString(), item.MontoCredito.ToString(), item.FormaPago, item.NumeroCuotas.ToString(), item.Estado } } ).ToArray() }; return(Json(productsData, JsonRequestBehavior.AllowGet)); }