Friday, February 25, 2011

simple application using mvccontrib grid

download the mvccontrib.dll, and add the reference of this dll to your application.


write a controller function:

public ActionResult salesreport()
{
handsetviewmodel vm = new handsetviewmodel();
return View(vm);

}



view code:

include the following namespace:

<%@ Import Namespace="MvcContrib.UI.Grid" %>
<%@ Import Namespace="MvcContrib.UI.Grid.ActionSyntax" %>


write the following code to display the grid

<%: Html.Grid(Model.handsetstock()).Columns(column => {

column.For(c=>c.itemcode);
column.For(c => c.imeicsv);


})%>