🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

Grid.Mvc

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Grid.Mvc

Package provides functionality to build GridView based on your model items collection. Grid.Mvc support sorting, filtering and paging your data.

3.1.0-ci1036
NuGet
Version published
Maintainers
1
Created
Source

http://gridmvc.codeplex.com/

Note: Grid.Mvc installer has already made the following changes to your project:

  • Views/Shared/_Grid.cshtml, Views/Shared/_GridPager.cshtml - views for grid
  • Content/Gridmvc.css - default stylesheet for the grid
  • Scripts/gridmvc.js, Scripts/gridmvc.min.js - Grid.Mvc scripts
  • Reference GridMvc.dll

Follow these steps to start use Grid.mvc:

  • Define a model for display in the grid, like:

    public class Foo { public string Title { get; set; } public string Description { get;set; } }

  • Prepare your model in your controller, like:

    public ActionResult Index() { var items = fooRepository.GetAll(); return View(items); }

  • Render GridMvc in the View: You can use Html helper extenstion:

    Reference Grid.Mvc.Html in your view:

     @using GridMvc.Html
    

    Render Grid.Mvc:

     @Html.Grid(Model).Columns(columns =>
     				{
     					columns.Add(foo => foo.Title).Titled("Custom column title").SetWidth(110);
     					columns.Add(foo => foo.Description).Sortable(true);
     				}).WithPaging(20)
    
  • Register a grid stylesheet and scripts in your _Layouts.cshtml file:

Notes:

Default layout of Grid.Mvc uses Twitter Bootstrap (css framework). You also need to include stylesheets on your page. You can download it from - http://twitter.github.com/bootstrap/ like:

<link href="@Url.Content("~/Content/Css/bootstrap.min.css")" rel="stylesheet" type="text/css" />

Also you need to ensure that jQuery has registred on the page before gridmvc.min.js script.

For more documetation, please see: http://gridmvc.codeplex.com/

Keywords

ASP.NET

FAQs

Package last updated on 31 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts