Copy to Clipboard
@using Infragistics.Web.Mvc
@using IgniteUI.SamplesBrowser.Models
@model IQueryable<IgniteUI.SamplesBrowser.Models.Northwind.Product>
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<!-- Ignite UI for jQuery Loader JavaScript File -->
<script src="http://cdn-na.infragistics.com/igniteui/2023.2/latest/js/infragistics.loader.js"></script>
</head>
<body>
@(Html.Infragistics()
.Loader()
.ScriptPath(Url.Content("~/igniteui/js/"))
.CssPath(Url.Content("~/igniteui/css/"))
.Resources("igGrid.Sorting")
.Render()
)
@(Html.Infragistics().Grid(Model).ID("grid").AutoGenerateColumns(false).Columns(column =>
{
column.For(x => x.ID).HeaderText("ID").Width("100px");
column.For(x => x.ProductName).HeaderText("Name").Width("200px");
column.For(x => x.QuantityPerUnit).HeaderText("Quantity").Width("200px");
column.For(x => x.UnitPrice).HeaderText("Price").DataType("number").Format("currency").Width("130px");
})
.Features(features =>
{
features.Sorting().Mode(SortingMode.Multiple);
})
.Height("400")
.DataBind()
.Render()
)
</body>
</html>
using IgniteUI.SamplesBrowser.Models.Northwind;
using IgniteUI.SamplesBrowser.Models.Repositories;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Linq;
namespace IgniteUI.SamplesBrowser.Controllers
{
public class LoaderController : Controller
{
//
// GET: /Loader/
[ActionName("aspnet-mvc-helper")]
public ActionResult AspNetMvcHelper()
{
IEnumerable<Product> products = RepositoryFactory.GetProductRepository().Get();
return View("aspnet-mvc-helper", products.AsQueryable());
}
}
}
using IgniteUI.SamplesBrowser.Models.Repositories;
using System;
namespace IgniteUI.SamplesBrowser.Models.Northwind
{
public class Product
{
public int ID { get; set; }
public string ProductName { get; set; }
public Nullable<int> SupplierID { get; set; }
public Nullable<int> CategoryID { get; set; }
public string QuantityPerUnit { get; set; }
public Nullable<decimal> UnitPrice { get; set; }
public Nullable<short> UnitsInStock { get; set; }
public Nullable<short> UnitsOnOrder { get; set; }
public Nullable<short> ReorderLevel { get; set; }
public string SupplierName { get; set; }
public string CategoryName { get; set; }
public int Rating { get; set; }
public bool Discontinued { get; set; }
public string CategoryImageUrl { get; set; }
}
}