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

Issue adding search filter to paged, sorted WebGrid

I'm having an issue getting my filtered results to post back into the paged, sorted webgrid properly. For example, my grid is limited to 5 items per page, but if the filter search returns 9 items, all 9 items are displayed on one page instead of…
Splendor
  • 1,386
  • 6
  • 28
  • 62
0
votes
3 answers

dynamic expression to method

I can't get it work @grid.GetHtml( tableStyle: "bordertable", columns: grid.Columns( grid.Column("aaaa", format: @ @Roles.GetRolesForUser(@item.UserName).LastOrDefault() ), grid.Column("UserName", "bbbb"), …
0
votes
1 answer

MVC WebGrid Conditional Concate Htlm.ActionLink

I'm trying to concatenate 2 Html.ActionLink in a conditionnal column in a WebGrid. somethings like that : @grid.GetHtml(columns:grid.Columns( grid.Column("AccountNumber"), grid.Column("ContractNumber"), grid.Column("DisplayName"), …
Calagan74
  • 21
  • 6
0
votes
1 answer

MVC 3 WebGrid Trying to Control Every Row's Permission

Why is this column not showing the links when I can see that the dictionary contains the keys and values. It looks like the index "item.Name" is not resolving. It was working fine before when I didn't have the permission if blocks. The plain format:…
chamo
  • 3
  • 3
0
votes
1 answer

WebGrid format not outputting anything

I have a table that I've built using a foreach loop in MVC 4 (Razor), and I'm trying to convert it to a WebGrid to take advantage of sorting. Currently, I'm just trying to get the format parameter to work for me so that I can recreate the columns…
zimdanen
  • 5,508
  • 7
  • 44
  • 89
0
votes
1 answer

how to implement Row per page using Drop Down box above Webgrid and update webgrid every selected value

i have create one Drop Downbox above Webgrid and if user select any value from Drop down box my webgrid change the row per page so...but it not work proper and my webgrid is not updated so please give me hint to implement it.. this is my Code..here…
Michel jeams
  • 103
  • 5
  • 17
0
votes
1 answer

WebGrid Dropdownlist error in MVC4

I am trying to develop a WebGrid with dropdownlist, where by default the selected value http://www.mikesdotnetting.com/Article/202/Inline-Editing-With-The-WebGrid //code in Controller (which grabs more than 1 set of data): ViewBag.material_codes =…
MiaoWin
  • 475
  • 2
  • 6
  • 14
0
votes
1 answer

i want to post the value of drop down in to My Actionresult method from javascript but it's not work..?

I have used one dropdown box above Webgrid for change the row per page at dynamically by user when i call the javascript and get the value and post to some URL ..but it's NOT post to my controller Actionresult method....so please help it;s…
Michel jeams
  • 103
  • 5
  • 17
0
votes
2 answers

ASP.NET MVC using WebGrid for showing SearchResults

I have a Search.cshtml View, that looks like that: @model IEnumerable @using (Html.BeginForm()) { @Html.DropDownList("Categorie", ViewBag.Categorie as SelectList); @Html.TextBox("Query");
willi
  • 15
  • 2
  • 6
0
votes
1 answer

If condition in webgrid

I want to show the image if the item has image, and no image otherwise. Here is my code, but it gets some errors. So how to use if condition in format parameter of webgrid? grid.Column("Image", "Ảnh minh họa", format: (item) => if(item.Image…
0
votes
1 answer

mvc4 webgrid cell with form, code won't render
tag

I have a webgrid in MVC4, and I want a custom column to have submit buttons - to resend the message to a specific person. The code of the column's format looks like this: format: @ @foreach (DataEntity entity in item.Entities) { using…
Avi Sasson
  • 666
  • 7
  • 22
0
votes
2 answers

TypeError: $(...).parent(...).delegate is not a function

I am using WebGrid in my project. When I inspect my code(of aspx page) in browser, I found error on console. It is : TypeError: $(...).parent(...).delegate is not a function and when I click on error line it shows me following CODE: $(function()…
Dhwani
  • 7,484
  • 17
  • 78
  • 139
0
votes
1 answer

Webgrid Column HTML.ActionLinks

Here is my Webgrid: { var grid = new WebGrid(Model, rowsPerPage: 15, ajaxUpdateContainerId: "PListGrid"); @grid.GetHtml( tableStyle: "webgrid", headerStyle: "webgrid-header-a", footerStyle: "webgrid-footer", …
Phillip O.
  • 135
  • 3
  • 10
0
votes
1 answer

How to get hit to httpPost action on clicking on sorting and paging in a webgrid MVC3?

I am new to MVC3 I am having a page with webgrid and some searching options on httpget my webgrid is blank as mine functionality is like that webgrid will have some data after my searching(means after page posts and upto this its working…
Vicky Kumar
  • 13
  • 1
  • 6
0
votes
2 answers

The connection name 'ApplicationServices' was not found in the applications configuration or the connection string is empty

I have just added Package from NuGet called "ASP.NET Web Helpers Library 2.0.20710.1"(Install-Package microsoft-web-helpers) in my Visual Studio 2010(MVC3, C#).I install this to use WebGrid in my application. When I run the project I got the error:…
Dhwani
  • 7,484
  • 17
  • 78
  • 139