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

The click event is not working when data added by jQuery ajax

Here is the mvc webgrid codes: @grid.GetHtml( displayHeader: false, htmlAttributes: new { id = "Grid1" }, tableStyle: "webgrad4", columns: new[] { …
green
  • 25
  • 6
2
votes
1 answer

WebGrid Paging not working

I have a dropdown and button control, on button click I am binding the WebGrid, which is working fine, on load grid will be empty, but after binding the grid paging is not working, below is my code @using (Html.BeginForm("EmpLog", "Labels",…
Rocky
  • 4,454
  • 14
  • 64
  • 119
2
votes
1 answer

Adding image to MVC 3 Web grid column header

recently i am using Web grid of MVC 3 . In one of the columns i need to display a image next to header text . Eg: + is this possible with MVC Web grid. thx
Bumble
  • 557
  • 3
  • 10
  • 24
2
votes
2 answers

How to display database image (bytes[]) in mvc WebGrid

I'm trying to display a byte[] image from database in a .NET MVC WebGrid Column. I`m doing the following steps (EF Model - Articulos) [Key] public int id_Art { get; set; } public int id_Pro { get; set; } [StringLength(1)] public…
Carlos07
  • 27
  • 6
2
votes
3 answers

MVC 3 RC2 Webgrid nightmares, anyone have paging working correctly?

I am using the latest RC2 version of MVC3. I have a webgrid and it is giving me horrible problems, specifically with the paging and sorting. I have been told that the paging should be more efficient now, and not pull back the whole table but only…
4imble
  • 13,979
  • 15
  • 70
  • 125
2
votes
1 answer

WebGrid paging not working when there is an ajax call

I am trying to implement simple grid through an ajax call. When I click on submit on index page a grid should be displayed as a key is sent through ajax code. But when I go to page 2 the key becomes null as the code goes to controller again and grid…
Mukul Jaggi
  • 100
  • 1
  • 8
2
votes
2 answers

how i can hide a specific asp.net WebGridColumn/s using hidden-phone Bootstrap class

I am working on an asp.net mvc-4 web application. and inside my view i have the following WebGrid inside my Razor view:- @{ var gridcolumns = new List(); gridcolumns.Add(new WebGridColumn() { …
John John
  • 1
  • 72
  • 238
  • 501
2
votes
1 answer

How to refresh mvc webgrid

I am using a WebGrid in my mvc application.
@grid.GetHtml( tableStyle: "gridTable", headerStyle: "gridHead", footerStyle: "gridFooter", columns: new[] { …
itzmebibin
  • 9,199
  • 8
  • 48
  • 62
2
votes
0 answers

ASP.Net MVC : How to customize webgrid pager UI

I need to add some html tag into webgrid pager. webgrid pager is a tfoot tag. My current grid UI looks like below picture. but i want my pager look like below picture. I want to add some image and text along with pager links. I took help from this…
Thomas
  • 33,544
  • 126
  • 357
  • 626
2
votes
0 answers

MVC Webgrid populated through AJAX call displays only the partial view and not the whole page (View) when clicked on 2nd page link (pager)

I am trying to load the mvc webgrid through AJAX call. I have an AJAX function in my view which calls a controller action. The data returned from the controller function is populated in the webgrid which is in partial view and rendered in my Index…
Coder12345
  • 21
  • 2
2
votes
0 answers

Issues while exporting pdf from webgrid in MVC

I was trying to export webgrid content as pdf. I am following same link provided in http://www.mikesdotnetting.com/article/205/exporting-the-razor-webgrid-to-pdf-using-itextsharp. But i am having issue with page GeneratePdf.cshtml .First of all…
peter
  • 8,158
  • 21
  • 66
  • 119
2
votes
0 answers

Change orientation of a webgrid asp Net

I have a WebGrid on an asp mvc page which displays its header columns horizontally, however I want them to be displayed vertically. Does anyone know how I can achieve this? This is what Im trying to achieve from this; to this; Thanks for your help…
NTinkicht
  • 972
  • 2
  • 12
  • 34
2
votes
1 answer

Add Bootstrap class to an asp.net mvc webGrid column

I have the following WebGrid column inside my asp.net mvc web application :- gridcolumns.Add(new WebGridColumn() { ColumnName ="Description",Header = Html.DisplayNameFor(model => model.Content.FirstOrDefault().Description).ToString(),CanSort=true , …
John John
  • 1
  • 72
  • 238
  • 501
2
votes
1 answer

WebGrid rendered inside partial view will raise "“jQuery is not defined”" , when trying to do ajax-based paging or filtering

I am working on an asp.net mvc5 web application. and i have the following:- 1. main view which contain @Html.Action, that calls an action method which return partial view. 2. inside the partial view, i define a web grid. 3.if i click on a link such…
John John
  • 1
  • 72
  • 238
  • 501
2
votes
2 answers

Razor webgrid get selected row data

In my Razor view, I have this webgrid: @{ var grid = new WebGrid(Model, canPage: false, selectionFieldName: "VendorClassID", canSort:false); } @grid.GetHtml( headerStyle: "header", htmlAttributes: new{id = "tableGrid"}, …
Snicklefritz
  • 355
  • 2
  • 6
  • 17