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

WebGrid Not staying checked between pages

I have a webgrid that works fine @{ var DB = Database.Open("CHAVI"); var grid = new WebGrid(DB.Query("SELECT [FileTrackingTag], FileID FROM (SELECT [FileTrackingTag], FileID, ROW_NUMBER() OVER (PARTITION BY…
Badmiral
  • 1,549
  • 3
  • 35
  • 74
0
votes
2 answers

Pagination on WebGrid deactivates after adding entries

I'm using a WebGrid with pagination in conjunction with an AJAX popup window to add new entries. I've noticed that after I've added an entry the pagination links at the bottom of the WebGrid become inactive. The popup calls the controller's Save…
Sperick
  • 2,691
  • 6
  • 30
  • 55
0
votes
3 answers

Check if any http query exists, not by parameter

Since MVC3 WebGrid sorting default is ascending via query string, &sortdir=ASC.. I would like to know how to sort initially by descending. I've tried below, using Request.QueryString, but in the case were there is absolutely no query string "?..",…
Ben Sewards
  • 2,571
  • 2
  • 25
  • 43
0
votes
1 answer

Present multiple IEnumberables and single value properties in single webgrid

I have an Inventory Class that contains not only its own fields but several reference IDs to other classes. public class Inventory { public int Id { get; set; } public string RtNum { get; set; } public string AcntNum { get; set; } public…
Joe
  • 4,143
  • 8
  • 37
  • 65
0
votes
1 answer

How to use webgrid ASP.net MVC 3.0?

I am new on ASP.net MVC 3.0, I want to display my data to WebGrid and I write this code in the View. @model IEnumerable @{ ViewBag.Title = "Index"; }

Index

@Html.ActionLink("Create New",…

Eddy Setiawan
  • 77
  • 1
  • 7
0
votes
1 answer

MVC3 WebGrid Pagination hide the next and previous links for a certain count of pages

I am developing MVC3 website and using mvc3 webgrid control in it. The problem which I encounter is to hide the > and < links for Previous and Next page of pagination when the page size is 5 or less otherwise it displays Normally. @{ var grid = new…
ovais
  • 339
  • 2
  • 13
0
votes
1 answer

MVC 3 Webgrid with dropdownlist, get selected value on postback

I have a webgrid with dropdownlist and onchange it postback the page. I am trying to get the selected value of the dropdownlist. Following is my Controller. public ViewResult Index() { //var albums = db.Albums.Include(a…
0
votes
3 answers

Showing the selected row details of web grid in popup

I have a webgrid in my my page with some data. Beside every row, there is as action link, edit. When the user clicks the edit action link, the selected row should be displayed in popup with Save and Cancel buttons on it.
being fab
  • 657
  • 3
  • 12
  • 22
0
votes
1 answer

using ajax loading search data to existing data grid

this is my action method public ViewResult Index(string firstName) { // get the list of employees according to the user name if (firstName == null) { return View((from e in db.Employees …
user1662380
  • 87
  • 1
  • 8
0
votes
2 answers

Operator '+' is ambiguous on operands of type '' and '' in Webgrid

I want to display some concatenated fields in a webgrid column and receive this error when the concatenated fields have null values SQL query: SELECT *, T.Name AS Title, PT.Name AS PropertyType FROM Properties AS P LEFT OUTER JOIN…
user1455103
  • 123
  • 2
  • 16
0
votes
1 answer

WebGrid MVC3 Dropdownlist

I have a webgrid with columns product, quantity, rate, and gross. I have a dropdownlist which has the list of products. Now based on the selection of the product I need to get the rate for the product. I think there has to be some callback method to…
0
votes
1 answer

MVC3 Webgrid with Checkboxes

I am a newbie to MVC3... I am trying to display a grid (3 columns) that contains list of students (in column1) with checkboxes in columns 2 & 3. The header of those columns are in order: student Name, Seminar1 & Seminar 2. The checboxes will…
user1019042
  • 2,428
  • 9
  • 43
  • 85
0
votes
1 answer

mvc get list from method in controller

I am new to MVC. I have one button that when clicked, opens a modal pop up (JQuery). In this modal I have 10 DropDownLists, and I create a specific key with all the selected values from those dropdowns. I also have another button that opens…
0
votes
1 answer

Is it possible to modify ASP.NET MVC WebGrid so that it doesn't look like a regular grid table?

I need to render a table that doesn't look like a regular grid table, where for one entry, which would be a row in a typical table, columns 1 and 2 values can be put in row 1, columns 3, 4 and 5 values will be in row 2, and so on like so:
UkraineTrain
  • 469
  • 1
  • 9
  • 21
0
votes
1 answer

How can I use ajax actionlink in WebGrid's header

I'd like to sort the data in WebGrid by clicking the header of the column with some other parameters post to the controller, but the WebGrid's autosorting supply a fixed link on the column header with only two parameters. I found some way to change…