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
0 answers

Trying to Submit View WebGrid Data to Controller - MVC3

I successfully added a WebGrid with a DropDownList that displays the correct data. I have each row set up for a user can set an error level for an error alert. So my question is how do I submit (HttPost) the WebGrid back to the Controller? I…
2
votes
2 answers

ASP.NET MVC 3 Razor WebGrid tooltip and sorting marker

I have developed a webapplication in ASP.NET MVC 3 Razor. I´ve bee using a WebGrid to list tabular data and would like to do xxx things with the webgrid. 1. I would like for the WebGrid to show which column is the sorting column and if it is sorting…
Ebbe
  • 43
  • 6
2
votes
1 answer

ASP.net MVC3 Webgrid

I am using a webgrid to display some dynamic data. I have recently refactored my code, to move away from a hierarchal Model, containing various different types of data to be displayed in a View to using ViewBag. Previously the grid would sort the…
Darren Young
  • 10,972
  • 36
  • 91
  • 150
2
votes
1 answer

How to edit row with Webgrid Razor MVC3

Can a WebGrid be made editable?
user833102
2
votes
1 answer

How to display dynamic Html.ActionLink label?

This code works, but displays "Details" for every row of my table: @appsGrid.GetHtml( tableStyle: "table", headerStyle: "head", alternatingRowStyle: "alt", columns: appsGrid.Columns( …
Max
  • 41
  • 3
2
votes
2 answers

Inserting Hyperlinks into the WebGrid

I have searched high and low, and it was only a few weeks ago I saw heaps of sites that had little samples for this, but for the life of me can't find them now! I have a webgrid, and for certain columns, I need to insert hyperlinks into the rows,…
bendr
  • 2,415
  • 6
  • 19
  • 24
2
votes
1 answer

How can I use DisplayFormat data annotation in WebGrid columns?

I have the following property in my model: [DisplayFormat(DataFormatString = "{0:d}")] public DateTime? Date { get; set; } And I am trying to use the Html.DisplayFor helper to use this specification in a WebGrid column, like…
Ben
  • 335
  • 7
  • 14
2
votes
2 answers

MVC 3 WebGrid Column Sort alphabatically, not according to table structure

I have assigned data to the webgrid but it sorting the columns alphabetically. it is not showing columns as like in asp datagrid according to table structure. for example if table have columns as" id title artid then grid showing them after…
Niranjan Singh
  • 18,017
  • 2
  • 42
  • 75
2
votes
1 answer

I want to insert rows into a WebGrid, using jquery

I want to insert rows into a webgrid using Jquery. I will get my values from textboxes on the page. var grid1 = new WebGrid(Model.dsvm as IEnumerable, canPage: true, canSort: false); …
2
votes
2 answers

How to return view after mvc controller action?

I created a functionality to delete a specific row in my webgrid table. This works fine but when the row is deleted I want my view to get refreshed and shows the actual data(after deleting a row). This is what I got so far: Webgrid view including…
NielsStenden
  • 357
  • 1
  • 6
  • 25
2
votes
2 answers

How to display Image from database in Html Helper Web Grid of [MVC 3.0 Razor]

I am working on Web Grid HTMl helper.I want to display data from database.I succeed in displaying two columns from database but dont know hoe to display image from database.I have made the Html helper to display image in database but how to use in…
Ravneet
  • 21
  • 3
2
votes
2 answers

Access Model Data in WebGrid

How do I access additional sub-model information within a WebGrid? var personGrid = new WebGrid(source: Model.People, ajaxUpdateContainerId: "personGrid", ajaxUpdateCallback: "jQueryTableStyling", defaultSort:…
JasCav
  • 34,458
  • 20
  • 113
  • 170
2
votes
0 answers

WebGrid throws exception on sort, but only on hosting provider

I'm using ASP.NET MVC 3 w/Razor. On one of my pages I am using a WebGrid to display data. If the WebGrid is instantiated as shown below, everything works fine. var grid = new WebGrid( Model, defaultSort: "StartDate", rowsPerPage: 20…
Craig W.
  • 17,838
  • 6
  • 49
  • 82
2
votes
1 answer

MVC 3 WebGrid with a checkbox filter

I'm developing a web application using MVC 3 RTM. In a view I have a WebGrid which works fine with sorting and paging. However, I also needed some filtering support on the page, so I added a textbox and a checkbox. The view code looks like…
René
  • 9,880
  • 4
  • 43
  • 49
2
votes
2 answers

JQUERY KeyPress event fires multiple times exponentially increasing each time

Application : MVC In my partial view code, I have a webgrid which has updateable text box columns. I am binding KeyPress event code for these text boxes to respond to Enter key and make AJAX call to update the database. My WebGrid is setup as…
Programmer
  • 53
  • 10