Questions tagged [webgrid]

WebGrid is a view control built in to the ASP.NET Web Pages Framework. It displays a sortable, pageable HTML grid given a collection, and is customizable in various ways, making use of .NET 4.0's "dynamic" object type.

The ASP.NET Web Pages WebGrid provides a kind of quick-scaffolded functionality for displaying tabular information in ASP.NET Web Pages, or ASP.NET MVC when using the Web Pages (Razor) view engine. Given an IEnumerable data source, it is possible to construct a functional HTML data table, with sorting and paging, with a single line of code in the View (Razor syntax, for example):

@( new WebGrid(data).GetHtml() )

The control offers customization of various styling, sorting, and paging functionality; as well as the ability to define the column contents either as raw data, or as templated HTML.

822 questions
10
votes
4 answers

Asp.net Mvc3 webgrid and paging

I am trying to learn Asp.net mvc. I know its different from forms and i need to change my way of thinking probably. My problem is about webgrid . When i add webgrid to my page and hit search button with Post it renders table with pager and so on.…
adt
  • 4,320
  • 5
  • 35
  • 54
10
votes
1 answer

Intermittent receive failure using mvc webgrid on server only

I am using the System.Web.Helpers.WebGrid extensively throughout our application, and for the most part it is fine and in fact running locally it is always fine or with a self SSL on the server it is also fine. So I don't know if the problem could…
Adam
  • 619
  • 1
  • 4
  • 19
10
votes
3 answers

How to use WebGrid in a cshtml view?

I am able to use WebGrid in any controller like: var grid = new WebGrid(emailsFetched, columnNames); I had to add a reference in my ASP.NET MVC project to System.Web.Helpers for this. But when I try to use this web grid in view directly (to avoid…
Cristian Boariu
  • 9,603
  • 14
  • 91
  • 162
9
votes
0 answers

Multiple Checkbox selection using Webgrid in MVC 3 (select All/Deselect All), Sorting and Paging

If you are wondering how to make multiple checkboxes and Multiple checkbox selection (select All or Deselect All),paging, sorting in a MVC3 Webgrid, here is the solution: To Simplify, It has the following features: Checkbox in the webgrid Multiple…
Ravi Ganesan
  • 99
  • 1
  • 1
  • 3
9
votes
1 answer

Sorting when two grids are on the same page

On my page I have two webGrids. When I click on one to sort that column, both of the grids are sorted on that column. Sorting on a column that is only in one, doesn't sort at all. I noticed the sorting works by making the header a link to the same…
Matthijs Wessels
  • 6,530
  • 8
  • 60
  • 103
9
votes
2 answers

How can I force a table cell onto a new row

I have an HTML table (generated by an MVC WebGrid) that is 5 columns across. What I want is the first 4 columns to take up 100% of the width and the 5th column to sit underneath also taking up 100% of the width.
Dark Hippo
  • 1,255
  • 2
  • 15
  • 35
8
votes
2 answers

MVC3 WebGrid Custom Text in Column

I'm developing a web application using MVC3 in VB.NET. I having difficulty setting a column on the webgrid with the following action links Edit | Details | Delete @*@Html.ActionLink("Edit", "Edit", New With {.id = currentItem.PrimaryKey})…
winsql
  • 731
  • 1
  • 8
  • 17
8
votes
1 answer

Advanced WebGrid tutorial or solution

I am looking for some tutorial or solution that shows how can I make a Webgrid with few advanced functionalities at once: paging, sorting, edit and delete buttons for every row, checkboxes for every row, edit and delete buttons for rows that are…
8
votes
2 answers

Inline editing of Webgrid row in MVC3

public class UserDetailsModel { public int ID { get; set; } public string LoginID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string IsDeleted { get;…
user1120418
  • 261
  • 3
  • 8
  • 18
6
votes
2 answers

MVC 3 WebGrid - is inline editing possible?

Has anyone implemented inline editing using the MVC 3 WebGrid helper? I've done a lot of searching on the topic, but haven't found much in the way of suggestions. Also, I'm not in the position of using other 3rd party or open source grids. …
user902849
  • 61
  • 1
  • 4
6
votes
1 answer

Why does the WebGrid use dynamic in formatting?

I'm working with the System.Web.Helpers.WebGrid in an ASP.NET MVC 3 Razor project, and I'm having trouble understanding why the format parameter for a WebGridColumn is a Func. If I create a column like this... grid.Column( …
Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211
6
votes
7 answers

Mvc 3 texbox in webgrid (razor)

Simple Q:How do you I get the textbox to show the value. Code below fail on item.LastName @model List @{ var grid = new WebGrid(source: Model,defaultSort: "FirstName",rowsPerPage: 3); }
user408698
  • 141
  • 1
  • 2
  • 7
6
votes
2 answers

CSS fix for webgrid's pager method using Razor and MVC3

I am using MVC3 with Razor, for display a grid I am using a WebGrid, and for paging for this very grid I am using the following code. My problem : The paging-buttons should keep the same size both when they are selected/clicked and when they are…
Yasser Shaikh
  • 46,934
  • 46
  • 204
  • 281
6
votes
2 answers

Displaying a boolean as a checkbox within a Webgrid

I am trying to use a Webgrid and I can get the data to display but the bool values are where I'm having problems. I would like to just display a checkbox that has the value of my bool. I have been able to get a checkbox within the grid but it is…
RicketyBowby
  • 63
  • 1
  • 4
6
votes
2 answers

MVC 3 Webgrid make entire row clickable

I am using webgrid in my razor view in MVC 3. Below is how my webGrid looks, I want to make the entire row clickable and on click pass values to the javascript method also. I am able to achieve calling my javascript method on text of all columns. I…
Yasser Shaikh
  • 46,934
  • 46
  • 204
  • 281
1
2
3
54 55