I have downloaded your JQuery Controls CTP for inspection as I am in the early planning stages of a MVC 3 web site project using the Razor view engine. Your samples downloaded with the CTP are all using the ASPX view engine even for the MVC 3 samples. Does Infragistics have samples of using the JQuery controls within the MVC 3 Razor view engine context?
Hi VaibhavJape2,
Here is a simple sample.
Controller code
public class PersonController : Controller
{
public IQueryable<Person> GetData()
return
Enumerable.Range(0, 100)
.Select(i => new Person { Id = i, FirstName = "FirstName" + i, LastName = "LastName" + i })
.AsQueryable();
}
public ActionResult Index()
return View(GetData());
[GridDataSourceAction]
public ActionResult GridDataAction()
View code
@using Infragistics.Web.Mvc
@using igGridMVCDataBinding.Models
@model IQueryable<Person>
@{
Layout = null;
<!DOCTYPE html>
<html>
<head>
<title>Index</title>
<link type="text/css" href="Content/themes/base/ig.ui.min.css" rel="stylesheet" />
<link type="text/css" href="Content/themes/min/ig/jquery.ui.custom.min.css" rel="stylesheet" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.js"></script>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>
<script type="text/javascript" src="Content/js/combined/min/ig.ui.min.js"></script>
</head>
<body>
<div>
@(
Html.Infragistics().Grid(Model)
.Columns(columns =>
columns.For(p => p.FirstName);
columns.For(p => p.LastName);
})
.Features(features =>
features.Paging().PageSize(20);
.Width("400px")
.Height("400px")
.DataSourceUrl(Url.Action("GridDataAction"))
.DataBind()
.Render()
)
</div>
</body>
</html>
Hope this helps,
Can you please the js files required in the scripts folder for binding Infragestic grid in MVC3. I am facing issues. It would be great if you can provide the complete sample code for binding grid in MVC3.Will be grateful for your help.. You can email me the same at puneetchabra@gmail.com.
Thank you very much. I had missed that in the drop-down.
It would seem that all the JQuery controls have MVC samples.
Thanks again!
Hi anthonyqueen,
Thank you for your intrest in Infragistics.
When you open a sample there is a drop down "Select Sample source file to View" from which you can select the source file that will be presented in the box bellow. For the MVC samples in this drop down you can find files with .cshtml extension, those show how to create the sample with the Razor view engine.
I've installed 11.1 (released today) and none of the samples that I've looked at so far are using the Razor engine.