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

Not update data in WebGrid ASP.Net MVC 4

I'm working with ASP.Net MVC4, jquery, razor In my view I use webgrid, I have an action "Anular" but when execute this action not reload o refresh the webgrid, how I can resolve this problem? this is my code, the controller updates the field but…
raranibar
  • 1,247
  • 4
  • 23
  • 44
0
votes
2 answers

Trying to Display Dynamic WebGrids Based On DropDownList Selection - ASP.Net MVC4

My Index view has a populated DropDownList of ClientIDs. My intention is to dynamically display a WebGrid of email addresses when one of the ClientIDs is chosen. Using the following jQuery code, I am successfully going to a controller action called…
user3041439
  • 153
  • 2
  • 2
  • 15
0
votes
1 answer

Crud in WebGrid

how to put delete, update, edit buttons into MVC webGrid ? code:
@{ var grid = new WebGrid(ViewData.Model, defaultSort: "EmplID"); } @grid.GetHtml()
controller: public class HomeController : Controller { public…
Evil rising
  • 442
  • 2
  • 7
  • 21
0
votes
2 answers

The query results cannot be enumerated more than once, MVC WebGrid issue

Error: System.InvalidOperationException: The query results cannot be enumerated more than once. Code: Controller: namespace EmployeeAttendance_app.Controllers { public class HomeController : Controller { public ActionResult Index() …
Evil rising
  • 442
  • 2
  • 7
  • 21
0
votes
1 answer

Access to a collection type in webgrid

I have used a webgrid in an asp.net mvc4 application @if( @Model.Count > 0){ var grid = new WebGrid(Model, canPage: true, rowsPerPage: 5); grid.Pager(WebGridPagerModes.All); @grid.GetHtml( tableStyle: "table_data", headerStyle:…
Lamloumi Afif
  • 8,941
  • 26
  • 98
  • 191
0
votes
2 answers

Add a vertical scroll to a webgrid within Asp.net mvc4 application

I have used a WebGrid in my asp.net mvc4 application @grid.GetHtml(tableStyle:"table_div", headerStyle:"table_header", columns: grid.Columns( grid.Column("Nom de la…
Lamloumi Afif
  • 8,941
  • 26
  • 98
  • 191
0
votes
1 answer

Webgrid rows based on a collection in Model. MVC4

I am trying to create a webgrid that will have rows of one column. The number of rows will depend upon the number of email addresses (strings) in the Model coming in. Here's the code of the view: @model BarClients.Models.BarClientsViewModel @{ …
user3041439
  • 153
  • 2
  • 2
  • 15
0
votes
1 answer

Data source not bound error in MVC 4 WebGrid upon refresh. TempData reseting

I have an MVC 4 application that displays a list of results from a search in a WebGrid. The results page loads correctly displaying all of the data matching the search. If I reload the page I get... "A data source must be bound before this…
Racksickle
  • 53
  • 2
  • 13
0
votes
1 answer

QTP - Identifying WebGrid using Div Tag

I have the following html tag for a Web Grid. How do I use it to identify this Webgrid using the unique Div ID in QTP. I need to use this div id as it's the only unique identifier.
0
votes
1 answer

WebGrid Custom Async Calls

I have a WebGrid declared as below: WebGrid grid = new WebGrid(rowsPerPage: Model.RowsPerPage, ajaxUpdateContainerId: "WebGrid"); I noticed where ever there is a data-swhglnk="true" attribute in a e.g. Columns for sorting, the asynchronous…
lbrahim
  • 3,710
  • 12
  • 57
  • 95
0
votes
1 answer

WebGrid paging href is changing

The first time I do paging it works fine. When I place the cursor over footer paging, it looks like http://localhostt:62535/Account/Index?page=3 If I perform any operation on WebGrid (edit or delete or visible), then the paging url is changed to…
Ram
  • 337
  • 5
  • 23
0
votes
1 answer

Population Asp.net mvc Webgrid from Hidden field

I have a hidden field with string value as "col1,col2,col3,col4". I want to split and loop that hidden string with create asp.net mvc webgrid as below with Razor. Could you please help me on…
Kurkula
  • 6,386
  • 27
  • 127
  • 202
0
votes
1 answer

Custom design using webgrid

I need to show records some thing like thing. Please check the Image give below. I need to show the records in webgrid. @{ MalayaleeTech.Models.NewLIst newsL = new MalayaleeTech.Models.NewLIst(); } @{ var grid = new WebGrid(Model.News,…
0
votes
1 answer

Can I have one DisplayName for data entry and the Column Headers in a gridview?

Is there a way to use the [DisplayName("My descriptive Name")] in headers and just the column name when I display data? (Without having to type each one in?) - (I used MVC scaffolding to create the edit page)

@Html.ActionLink("Create New",…

Danimal111
  • 1,976
  • 25
  • 31
0
votes
1 answer

How to change MVC Web Grid structure?

I am trying to show list of items in a MVC 4 Web Grid control. But I am unable to re-format my web grid as table structure below. Web Grid structure like this. Table structure like this. Here is my razor code for web grid. @{ var grid =…
sridharnetha
  • 2,104
  • 8
  • 35
  • 69