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

Sorting by two columns on an MVC wegrid

At the moment I have a Webgrid which is somewhat like this... Server | Application | Details ---------+---------------+------------- Server1 | Application1 | Example1 Server2 | Application2 | Example2 Server3 | Application3 | Example3 …
Joe Harper
  • 470
  • 2
  • 11
0
votes
1 answer

Using MVC3 Webgrid, how do I preserve the grid in the session so I can return to the page I was on before?

Sorry if the title is a little confusing, but basically my questions is this. I am on Page A, Page A contains a search which filters data in a Webgrid. The webgrid has ten rows per page. I've searched for something in the filter, and the webgrid has…
Joe Harper
  • 470
  • 2
  • 11
0
votes
1 answer

Change background of specific cells

When I have setup a webgrid like this: Id | Name | Last Name 1 | Eve | Beckham 2 | John | Doe 3 | Eve | Davis 4 | Jacky | Jackson 5 | Michael| Jackson Is it possible, that when a user hovers over a cell containing "Jackson" that…
suspic
  • 51
  • 8
0
votes
1 answer

add js function as parameter in url.action

I want to change the value of a textbox at runtime. I have this JavaScript function, which returns a textbox value: function getValue(str) { var textboxValue = document.getElementById(str).value; return textboxValue; } This is my…
Fadi Alkadi
  • 781
  • 4
  • 12
  • 22
0
votes
0 answers

How to avoid losing values of textbox of a first page when click to next page - webgrid

ASP.NET MVC 4 and C# - I need to know how to avoid a refresh webgrid page when click next page without losing values of textbox (txtMessage). My problem is that when I input values in some Message textbox in a first page and then click the next page…
0
votes
1 answer

mvc 4 - how to return empty list from webgrid instead of throwing error

I am using ASP.NET MVC 4 and C#. I wrote code to display data from a webgrid by retrieving data from database. It worked. But if there is any bad case like database broken or something, it would fail to retrieve data so I would like the webgrid to…
user2857908
  • 91
  • 3
  • 16
0
votes
1 answer

Error: Object [object Object] has no method 'spinner' in MVC webgrid

I have a web grid and i need to make a numeric up down column in the web grid. For it I am using the jQuery UI Spinner control. just a look: grid1.Column("Salary",format: (item) => Html.TextBox("Salary", (int)item.Salary, new { @class =…
0
votes
1 answer

WebGrid in Partial View - Stop paging from reloading page

I have a dashboard type page which contains multiple partial views each of which contain a webgrid. For example this is web grids is in my _CurrentSubscriptions partial view: WebGrid grid = new WebGrid(Model.Titles, rowsPerPage:…
DazManCat
  • 3,540
  • 5
  • 30
  • 33
0
votes
1 answer

WebGrid all buttons submits the form

I have a grid within a form-tag. Each row in the grid has two buttons, wich of one is of type submit. I thought that only the submit button would fire of the form submission. But all buttons actually post the form. Why is that? What's the reason to…
Josef
  • 585
  • 1
  • 7
  • 19
0
votes
2 answers

How do I programatically clear the HasSelection property of the WebGrid?

Self explanatory question. Between posts, the grid I have setup is retaining the HasSelection bit, even if the WebGrid has been re-loaded with new data. Therefore, the functionality I have wired into the physical selection of a WebGrid record runs,…
TheHolyTerrah
  • 2,859
  • 3
  • 43
  • 50
0
votes
0 answers

Query working in SQL but not in MVC Controller

i am executing a Store procedure from MVC controller, i am sending dates to it , on basis of that it sends records but problem is that When i SEND 2 dates like FROM.....TO then it sends correct result, but when i send only FROM date then it shows…
Evil rising
  • 442
  • 2
  • 7
  • 21
0
votes
1 answer

columns doesn't appear in order in webgrid

i am picking names from sql store procedure to display it in WEBGRID. I am usign MVC 3 and linq to sql. but issue is that when i pick column names from database then it is not ordered as it is in Database. e.g. in database it displays as EmpName …
Evil rising
  • 442
  • 2
  • 7
  • 21
0
votes
0 answers

MVC4 WebGrid in dialog hangs in IE and no pagination in Chrome

MVC4: I am new to using WebGrid with MVC. Code below produces WebGrid inside dialog, but pagination does not work in Chrome ( blank page displayed) and in IE : dialog with WebGrid shown , but IE hangs (seem to be doing something and then hangs, no…
Karen Slon
  • 233
  • 1
  • 4
  • 16
0
votes
1 answer

Cannot update database entry and refresh dynamic WebGrid using jQuery - ASP.Net MVC

I am successfully dynamically displaying a WebGrid based on selected item of a DropDownList. If I select another item in the DropDownList, I will see a different WebGrid. Before stating what I am trying to do next, here is how I have achieved the…
user3041439
  • 153
  • 2
  • 2
  • 15
0
votes
1 answer

No HTML Markup Visible of WebGrid asynchronously loaded using jQuery and Ajax - ASP.Net MVC

I am successfully using jQuery and Ajax on my MVC app to asynchronously load a WebGrid based on a selected item of a DropDownList. I can see the WebGrid and its contents on the view. However, if I then attempt to look at Page Source (to see the HTML…
user3041439
  • 153
  • 2
  • 2
  • 15