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

Using WebGrid with sortable columns, the call to the controller bypasses the Session

In ASP.NET MVC 4, I have a multipage app that does some security checking on the first page, stores the results in a Session variable, then uses OnActionExecuting on every Controller to test the Session variable as I move from page to page. One of…
Kelly Cline
  • 2,206
  • 2
  • 33
  • 57
0
votes
1 answer

How to hide/remove a specific column in WebGrid MVC4 using Javascript/Jquery?

I have WebGrid id="EmployeeGrid". I want to hide/remove a specific column say column 4 within this grid. I am using below code using jquery but it hide column 4 of all grid in this page. I want to hide a column of a specific grid using…
user3477335
  • 165
  • 1
  • 2
  • 12
0
votes
1 answer

How to show image instead of text in WebGrid header

I am trying to use the WebGrid in My MVC 4 application and in my grid I want to display images in header .So please give some example for this, how can I achieve this. I tried searching on internet but didn't get any feasible solution. Thanks in…
Kumar
  • 303
  • 6
  • 17
0
votes
0 answers

Show default text if there are no records or when data source is empty

On page load, if there is empty data source or there are no records, I need to show the default text in my WebGrid. @if (Model.CustomerList.Count == null || Model.CustomerList.Count == 0) { No records found. }
Vignesh
  • 11
  • 1
  • 3
0
votes
1 answer

ASP MVC WebGrid pagination link generation

ASP MVC WebGrid renders pagination links like http://host/AnyController/AnyAction?Length=4&page=1 Any chance to parametrize or customize this to http://host/AnyController/AnyAction/1 to conform better to MVC routing conventions? (NOT important:…
g.pickardou
  • 32,346
  • 36
  • 123
  • 268
0
votes
1 answer

how to adjust only first column width of the dynamic webgrid?

I have the dynamic webgrid which binds the data from backend dynamically in ASP.NET MVC.. here i want to adjust the width of the first column in that dynamic webgrid.