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

MVC4 Razor WebGrid Error

I am trying to use WebGrid on my Razor views, but I am getting this error message : Compiler Error Message: CS1978: Cannot use an expression of type 'lambda expression' as an argument to a dynamically dispatched operation Here is the controller's…
Edik Simonian
  • 23
  • 1
  • 7
0
votes
2 answers

webgrid selected row MVC 3

I have 2 WebGrid. I want to use the property SelectedRow. in the first WebGrid works well, but the second not. This is the main view (WebGrid 1), here called a partial view that contains the second WebGrid: @model…
kalu
  • 337
  • 2
  • 9
  • 19
0
votes
3 answers

Webview giving Column Does not Exist Error

I am using MVC 3 VB.NET and Razor ViewEngine. I am playing around with WebGrid in my application and it is telling me "failEmList" does not exist. Below is the code from the calling Function, the View, and the part of the model that it is…
Skindeep2366
  • 1,549
  • 3
  • 41
  • 68
0
votes
2 answers

webgrid sort not working

I'm using webgrid to show data from my data base. The problem is that sort option is not working Here is my webgrid code @{ var grid = new WebGrid(Model, canPage:true ,canSort:true, rowsPerPage :4); …
Kira
  • 1,153
  • 4
  • 28
  • 63
0
votes
1 answer

Add links into a webgrid

I'm working on an mvc .net web application. I used a webgrid to show data from my database. @{ var grid = new WebGrid(Model, canPage:true , rowsPerPage :6); grid.Pager(WebGridPagerModes.NextPrevious); @grid.GetHtml(tableStyle:…
Kira
  • 1,153
  • 4
  • 28
  • 63
0
votes
1 answer

How to hide the webgrid when execute the page in mvc3 razor?

When I remove the webgrid and layout=null in the view, its executing and client side validation message is displaying... but When I execute the page with layout= nlll and Webgrid it displaying the below error "A data source must be bound before this…
Sham
  • 1,191
  • 2
  • 13
  • 25
0
votes
1 answer

MVC Webgrid Paging and Sorting Stops Working After Ajax Calls

I have created an MVC application that uses webgrids to display data on my views. In my grid's toolbar I have drop downs, text boxes and a search button that call Jquery to perform various actions. For example, if I click the search button, I…
Hiszorn
  • 23
  • 1
  • 4
0
votes
1 answer

MVC Calculate sum of selected values from Webgrid

I have a ASP.NET MVC 4 application with EF. In my Index view I have a webgrid with a list of items. At the bottom of the page I have calculated the sum of my webgrid items(Total value). I have a checkbox at the end of every row. @helper…
Misi
  • 748
  • 5
  • 21
  • 46
0
votes
2 answers

mvc3 webgrid filter with listbox

I have a webgrid with sorting and paging enabled. I also have some dropdownlists and listboxes on the same view to filter the webgrid result. The filters are placed inside a form with http get method. I applied jquery on the filters to submit the…
mortdale
  • 382
  • 4
  • 16
0
votes
1 answer

MVC 3 WebGrid with a dynamic source

I have a dynamic list of data with a dynamic number of columns being created by a PIVOT function. Everything more or less works, but I wanted to apply some custom formatting to some of the columns. I figured out how to get a list of the columns by…
ewahner
  • 1,149
  • 2
  • 11
  • 23
0
votes
1 answer

Format webgrid column bound to collection?

Here is my webgrid:
@grid.GetHtml( tableStyle: "grid", headerStyle: "head", alternatingRowStyle: "alt", columns: grid.Columns( grid.Column("FullName", "Name"), grid.Column("User.Email", "Email",…
BBauer42
  • 3,549
  • 10
  • 44
  • 81
0
votes
1 answer

How to access a strongly typed complex mode properites with WebGrid

How do you access a strongly bound complex type in a webGrid within MVC 3. Example, I have an object called Project that has another object as a property called Employee. The two objects relate to each other on a primary key EmployeeId. If the…
TampaRich
  • 793
  • 2
  • 9
  • 22
0
votes
1 answer

TextArea in mvc web grid

I have a GridView, how do I display in a TextArea the information of the field "Content"? @grid.GetHtml( fillEmptyRows: false, mode: WebGridPagerModes.All, firstText: "<< First", previousText: "< previous", …
kalu
  • 337
  • 2
  • 9
  • 19
0
votes
1 answer

asp.net mvc webgrid update selected rows(checkbox)

I'm using ASP.NET MVC 4 with EF. I want to add CheckBox at the end of every row.(this checkbox is not in my Model) grid.Column("Verified", format: @) ... @Html.ActionLink("Verified",…
Misi
  • 748
  • 5
  • 21
  • 46
0
votes
1 answer

ASP.NET MVC 4 WebGrid EF

I have some short questions about the Webgrid. How can I put in a column the current number ? (I'm using EF) How can I display a string instead of a integer ? (Let's say I have a int field height and if it's between 1.50- 1.60 I would like to see…
Misi
  • 748
  • 5
  • 21
  • 46