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

Retaining search filter with WebGrid paging MVC 4

I am unable to retain the filter (search) across pages in Webgrid. As in when next page is clicked, the search criteria is lost. Any ideas?? Partial View: @model IEnumerable @using…
who-aditya-nawandar
  • 1,334
  • 9
  • 39
  • 89
0
votes
2 answers

MVC Webgrid show only 1 Model column

I try to display a list in a Webgrid but the view shows only one column and no matter what I do I can't seems to get it to show the other columns (my model has 3 properties and one of them is complex and contains 4 properties so I expect 6…
user1707621
  • 95
  • 1
  • 2
  • 9
0
votes
1 answer

Using radiobuttons in mvc webgrid?

I have a WebGrid on my form, inside that I have a column called 'duration'. In this column I'm displaying 2 radio buttons, so the Admin should select one validity period for that user on every row, either 30 days or 90 days and submit. And here I…
claudia
  • 23
  • 1
  • 7
0
votes
1 answer

WebGrid: next page does not remember hidden element

I am creating an application in c# with mvc 2010 Express and I have one view with a drop down list to select a code. It redirects the user to another view (Filter view) with another drop down list to select a market. Then, depending on which code…
eryel
  • 103
  • 1
  • 1
  • 11
0
votes
1 answer

Wrapping Text In WebGrid Columns

I working on a project in MVC 4 where I am leveraging WebGrid to display various data elements for my models. Currently, one of my models has a text property that accommodates a large amount of text. Yet when it is displayed via WebGrid, the text…
Athegreat
  • 1
  • 1
  • 1
0
votes
1 answer

Show and hide an input button in web grid table

I am trying to make a button in a web grid table that says edit, then on click hide edit button and show save button I have tried jQuery .hide and .show but they don't appear to work in a table. Any advice welcome.
0
votes
1 answer

How to download WebGrid Data in a PDF file?

I have a Web application which implemented in MVC (Razor) environment. Inside this application, there is a page that shows data from SQL Server(using Entity Framework) with WebGrid. I want to know that how can I embed a button to download this…
Raha
  • 163
  • 1
  • 2
  • 12
0
votes
1 answer

Mvc webgrid sort clears DOM

I've got script and style thats applied dynamically to column values in the webgrid. Everything works fine until I sort a column and thats when classes or styles are removed. I've tried my code in the _layout as well as the view..
foxtrotZulu
  • 1,109
  • 11
  • 24
0
votes
1 answer

MVC 4 WebGrid DropDownLIstFor selectedValue

I have a web grid in a partial view. Each column has a display and edit mode. The display mode uses labels to display the data. When a user selects "Edit", the display mode is hidden and the edit mode is displayed. Everything works, except for…
lv2rftak
  • 21
  • 1
  • 9
0
votes
2 answers

Combine 2 MvcHtmlString Togther inside 'Format'

grid.Column(format: v => @Html.ActionLink(@item.Name, "Details", new { id = item.Id }).ToString() + (v.State == State.Y ? @Html.ActionLink("Start", "Start", new { id = v.Id }) :…
Yacov
  • 1,060
  • 14
  • 27
0
votes
1 answer

Two Controls in the same Column of the WebGrid

I have a webGrid with 2 columns and in the first column I have Dates and in Second Column I have one more WebGrid which contains Data according to that Date. Now what I want is I want a Button in the same column in which I have my inner WebGrid. How…
Vishal
  • 604
  • 1
  • 12
  • 25
0
votes
1 answer

mvc asp.net: webgrid paging doesn't work

I'm working on a webgrid using mvc 3 razor and the paging simply does not work. there is paging but the link is just a '#'. I made another one in another project, which is exactly the same code and it works perfectly! The only difference between…
0
votes
1 answer

webgrid default sort direction

when i add the web grid to my page in mvc project it sortes the data ascending on first click. but i bring the data already sorted ascendin. then nothing happens. i want webgrid to sort descending at first. you can see the code of my grid…
brtb
  • 2,201
  • 6
  • 34
  • 53
0
votes
1 answer

Using Webgrid to create tag

I tried to render a table using WebGrid, but the structure that using WebGrid render doesn't contain tag, and it renders only inside tag inside ''. Can anyone help me how to render tag without using ? such as : ` …
echo
  • 167
  • 1
  • 1
  • 12
0
votes
1 answer

Add links to a webgrid ASP.NET MVC3

I am trying to add links to individual rows in my webgrid. Here is the code: @gridModel1.GetHtml(columns: new[] { gridModel1.Column("id"), gridModel1.Column("Column2"), gridModel1.Column("Column3") }) Table displays like: id | Column2 …
scapegoat17
  • 5,509
  • 14
  • 55
  • 90