Home > DeveloperSection > Forums > How to use WebGrid in mvc
Ankit Singh

Total Post:341

Posted on    December-25-2015 9:36 PM

 .NET C#  .NET  Mvc  Mvc3  Mvc2  Mvc4  Mvc5 

 1 Reply(s)
 545  View(s)
Rate this:
I want to use WebGrid in mvc how to do this please help me.

aditya kumar Patel

Total Post:254

Posted on    December-25-2015 9:42 PM

WebGrid is most powerful tools to list records from database in web application. Like ASP.NET Web Forms GridView, DataList, ASP.NET MVC didn't had any built in data controls. WebGrid that does almost all work of ASP.NET Web Form GridView and it is simple enough too.


@model IList<ForumMVC.Employee>
    ViewBag.Title = "Index";
var grid = new WebGrid(Model);

<h1>Employee List </h1>
<div id="grid">



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ForumMVC;
using System.Data.Entity;
namespace ForumMVC.Controllers
    public class HomeController : Controller
        forumEntities db = new forumEntities();
        public ActionResult Index()
            List<Employee> Emplst = db.Employee.ToList();
            return View(Emplst);

Modified On Dec-25-2015 09:46:24 PM

Don't want to miss updates? Please click the below button!

Follow MindStick