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
0
votes
1 answer

Funny issue with CSS and WebGrid

Here is a funny problem that I encountered. I am using Asp.net MVC WebGrid in my project. I am trying to apply some CSS to it. So changed the code to @grid.GetHtml(footerStyle: "pagination") Now, the pagination class has some code like…
Aditi
  • 1,188
  • 2
  • 16
  • 44
0
votes
1 answer

ASP.NET MVC HtmlDecode WebGrid Column

I want to use System.Web.HttpUtility.HtmlDecode with WebGrid but it is not working my code is : grid.GetHtml(tableStyle: "webGrid", htmlAttributes: new { id = "DataTable" }, headerStyle: "header", …
shailendra
  • 205
  • 1
  • 8
  • 21
0
votes
1 answer

How to set dynamic column header in webgrid?

I have used web grid to display employee name, and the projects in a drop down against each employee. For Projects drop down column I have to display the date as column heading which is returned from a HTML helper. i.e. as per the below code instead…
Suma
  • 13
  • 1
  • 4
0
votes
1 answer

Apply Webgrid Pagination to a table

My question is simple. MVC3 has a Webgrid Helper which can be used for paging. Is there a way to use this helper in a table instead of using the webgrid? Please advise me in this.
sameer
  • 220
  • 2
  • 6
  • 18
0
votes
1 answer

WebGrid form posting in ASP.NET Web Pages Razor v2

OK, typical problem: I have a table with 7884 of records (for now—but there will be lots...) I want to offer admins a quick way to monitor this table through the web. I also need to provide viewers the ability to specify some filtering to further…
Fernando Espinosa
  • 4,625
  • 1
  • 30
  • 37
0
votes
1 answer

Can WebGrid columns be set on the server side?

I understand how to add columns with Razor syntax in the view but I was wondering if there is a way to create the WebGridColumns on the server side and hand it off to the WebGrid.GetHtml method on the razor side?
John S
  • 7,909
  • 21
  • 77
  • 145
0
votes
1 answer

pagination on filtered data getting lost on when clicked on second page in webgrid

I've created a WebGrid in an MVC3 web application. In my application sorting,filtering and paging are enabled. Problem : Whenever a filtering is performed on the webgrid, it populates the filtered data to Webgrid. But if i click on the second page…
Karthik Chintala
  • 5,465
  • 5
  • 30
  • 60
0
votes
1 answer

Multiple submit buttons in Webgrid MVC4

I have a WebGrid in My Index and have two submit buttons to perform separate actions. Webgrid from this code How to direct to the respective actions when the button is clicked on post. But When I submit on any of the buttons, the first [HttpPost]…
kk1076
  • 1,740
  • 13
  • 45
  • 76
0
votes
1 answer

Using checkbox in webgrid MVC3 Razor - how to get row values

I have a webgrid and each row has a checkbox. When the checkbox is clicked I want to somehow get the values of that row to my actionResult method via jQuery Ajax. The actionResult and jQuery Ajax part are not a problem but I don't know how to get…
nick gowdy
  • 6,191
  • 25
  • 88
  • 157
0
votes
1 answer

how to handle wierd column format

I have the following in my webgrid: grid.Column(header: "Action", format: delegate(dynamic i) { return Ajax.ActionLink("Remove", "SomeAction", new {dataId = @i.id}, new…
Kixoka
  • 989
  • 4
  • 15
  • 37
0
votes
1 answer

MVC3 WebGrid print entire grids value instead of just page

I am going to be really surprised if this is possible but here goes. I am using the MVC WebGrid and have paging enabled to mange screen real estate better. All was going well until the end user asked when they print the page they want to see all…
Diver Dan
  • 9,953
  • 22
  • 95
  • 166
0
votes
2 answers

jquery code works once but not repeatedly

i have a small jquery script that when I click an ajax actionlink in a grid/table(built from a webgrid) it will replace the contents with a spinning wheel. It works the first time only. $('#thisGrid tr td').click(function () { …
Kixoka
  • 989
  • 4
  • 15
  • 37
0
votes
2 answers

inside webgrid create a checkbox

i want to create a checkbox option inside webgrid with value as int below how i have done... grid.Column("",header:"Select",format:(item)=>Html.CheckBox(String.Format("{0}",(int)item.ID),false,new{id="chkSelected", Style="width:60px"})), it is…
aamankhaan
  • 491
  • 1
  • 9
  • 35
0
votes
3 answers

Mvc3 webgrid conditional statement on column

i have a webgrid in which i want to place a conditional statement on the column data that i will have? is it possible and if yes, can you provide an example? EDIT Just a snippet grid.Column("Status","Status",canSort: true) if the value of the…
sameer
  • 220
  • 2
  • 6
  • 18