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

ASP.NET MVC4 cannot sort webgrid by a DateTime column

In my application I have a webgrid defined as this: @model IEnumerable @{ ViewBag.Title = "Unscheduled Jobs list"; var webGrid = new WebGrid(Model, rowsPerPage: 12, canSort: true, canPage: true,…
0
votes
1 answer

ASP.NET MVC template with webgrid instead of table

Is there a Asp.net MVC View Template that uses WebGrid instead of a ?
0
votes
1 answer

WebGrid MVC3 renders as string instead of Html

I'm using MVC3 WebGrid, and got this simplest cshtml, that won't work @model IEnumerable @{ var grid = new WebGrid(source: Model); } @grid.GetHtml() But this code, do work @model IEnumerable @{ var…
RMalke
  • 4,048
  • 29
  • 42
0
votes
1 answer

WebMatrix 3 - WebGrid and ADO.NET Dataset with DB2

I'm querying a DB2 server using WebMatrix. I figured it would be easier for quick, proof of concept related tasks... but using DB2 rather than its built-in providers has been challenge, to say the least. I know my results are coming back since I…
user500741
  • 833
  • 5
  • 14
  • 25
0
votes
1 answer

Styling the header of a webgrid in mvc

I have the column below and I will like to style the header. I have not had any luck doing this. Do you have an idea? gridColumns.Add(grid.Column("PastDue", header: T("PastDue"), canSort: false, format: item => item.PastDue));
Baba
  • 2,059
  • 8
  • 48
  • 81
0
votes
1 answer

Webgrid generating 'data-swhglnk' makes it impossible to use arrows for sorting

As the title of this question says I'm unable to add the arrows to my webgrid when data-swhglnk='true' is present on my link, which is autogenerated by Webgrid. I have searched for this attribute but none explains me how I can modify this attribute…
thomvlau
  • 602
  • 3
  • 9
  • 24
0
votes
1 answer

Hiding columns in a webgrid in mvc application

I have two columns that I will like to hide in a webgrid. This webgrid resides in a partial view. Here are the columns below gridColumns.Add(grid.Column("PaymentAmount", header: T("Payment
Amount"), canSort: false, format: item =>…
Baba
  • 2,059
  • 8
  • 48
  • 81
0
votes
1 answer

Cannot Get Hidden Property for Hyperlink or Button

I have custom HTML Helper method in my MVC4 project and this method returns an html url for WebGrid as below: I use this image as a button for the Actions column on my GridView. On the other hand…
Jack
  • 1
  • 21
  • 118
  • 236
0
votes
2 answers

Displaying Multiple Image Links instead of Text in WebGrid?

I have a WebGrid definition and three links in a single column by using Html.ActionLink. But, when I do not use "LinkText" property, the applicantId property is passed as null value to the Controller. On the other hand, when just using LinkTexts…
Jack
  • 1
  • 21
  • 118
  • 236
0
votes
2 answers

Proper way for delete function in ASP.NET MVC 4 WebGrid

I just started using WebGrid and I have been searching a proper way to delete a row. But I don't want to use solutions which redirects the user an other window. I just want that when the user clicks delete then pop up a confirm window and if the…
dvjanm
  • 2,351
  • 1
  • 28
  • 42
0
votes
1 answer

Sticky header for WebGrid in MVC

I'm making an admin app using web grid where users can view tables I pull from a database and display using a WebGrid. Right now I'm trying to have a sticky header in the webGrid. The jQuery methods I found all involve setting the header "position"…
0
votes
1 answer

asp.net mvc 4 webgrid sorting issue of enum datatype column

In MVC4 Web Grid, Iam binding Web Grid from server side for efficient paging and sorting. Sorting is working fine for all columns except one column i.e the datatype of column is ENUM. I have tried with grid.bind() samples that are present in this…
amshekar
  • 31
  • 2
  • 7
0
votes
1 answer

How to show two WebGrid in one view

I am facing the issue , i want to display two Webgrid in one view , so i create separate view for each , and calling on one view using
@{Html.RenderAction("NewRegisterCustomer", "AdminDeshboard");} …
user1035814
  • 184
  • 2
  • 4
  • 14
0
votes
1 answer

Form Post not working after showing details in webgrid in MVC 4

I am using Webgrid in one of my project and all of the functionalities (Add, Edit, Delete, Details) are working fine. I am using ajax post method to delete the records on the same form. So when I simply click on Delete it removes the record from…
Raina
  • 13
  • 1
  • 6
0
votes
2 answers

MVC Razor WebGrid Get Selected Row on Button Submit

How can i get WebGrid Selected Row into Hidden Variable. I am using the following code. @{ var grid = new WebGrid(@ViewBag.ImageFiles, canPage: false, rowsPerPage: 5, selectionFieldName: "SelectedRow", ajaxUpdateContainerId: "gridImages"); }
Siva
  • 27
  • 2
  • 2
  • 9