Is it possible to create grid in asp.net MVc3.0. The gridview that is used in asp.net similar to that if yes then please let me know how to create a simple grid in asp.net mvc3.0 I m using sql server Database to fetch data, that has to be filled in grid. Thanks.
Asked
Active
Viewed 5.3k times
4 Answers
18
There are different possibilities:
Server side grids:
- The built-in WebGrid helper
- MvcContrib Grid
- Telerik Grid
Client-Side grids:
and many others...

Darin Dimitrov
- 1,023,142
- 271
- 3,287
- 2,928
-
jqGrid sucks... Well let me not be negative. Its not easy to work with by any means, but it does the job. – SoftwareSavant Jun 07 '12 at 13:32
-
@darin what is the difference between client side grid and server side grid – taher chhabrawala Oct 04 '12 at 16:25
-
The first is generated on the client using javascript and the second is generated on the server. – Darin Dimitrov Oct 04 '12 at 16:27
-
First link to WebGrid helper is broken. Please don't just include links without actual data or examples! – UeliDeSchwert Jun 18 '15 at 07:38
13
You can use WebGrid in MVC3. This is new in MVC3. Use this code in your View.
@model IList<YourViewModel>
@{
ViewBag.Title = "Amend Absence";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@{
var grid = new WebGrid(source: Model, rowsPerPage: 200,
canPage: false, canSort: true, defaultSort: "Absentee");
}
<p>
<h2>Absentee List</h2>
<div id="grid">
@grid.GetHtml(
tableStyle: "grid",
headerStyle: "head",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column(format: (item) => Html.ActionLink("Edit", "Edit",
new { id = item.Id })),
grid.Column("Absentee", "Absentee",canSort:true),
grid.Column("AbsStart", "AbsStartDate")
))
</div>
</p>

JiBéDoublevé
- 4,124
- 4
- 36
- 57

Hari Gillala
- 11,736
- 18
- 70
- 117
0
You need to create it using TABLE / TR / TD tags.
Here is few links which may help you