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

MVC3 WebGrid showing custom class objects from model into columns

I'm trying to show a model in a WebGrid which has one column with a custom class. Without using the "format:" parameter to customize the column in the WebGrid, can I add something to my custom class (something like a default cast= to show a custom…
0
votes
1 answer

WebGrid with Select * Like *

I use a WebGrid to display the result of: select * from table where column like '**'; There is no problem displaying the result. However, if I click the column name of the WebGrid to sort the results, I will get an error or there is nothing…
ZZYTIGER
  • 1
  • 1
0
votes
1 answer

Computed column on a MVC3 razor Webgrid

Here is my webgrid .I am trying to add a column "EndDate" which displays a calculated value var grid = new WebGrid(canPage: true, rowsPerPage: Model.PageSize, canSort: true, ajaxUpdateContainerId: "grid"); grid.Bind(Model.MyRecords, rowCount:…
Millar
  • 1,095
  • 6
  • 16
  • 34
0
votes
1 answer

mvc webgrid ajax paging

@{ var gridUser = new WebGrid(canPage: true, defaultSort: "CreatedOn", rowsPerPage: 5, ajaxUpdateContainerId: "Divxyz"); gridUser.Bind(Model.abc, rowCount: Model.User.Count(), autoSortAndPage: true); …
Kurkula
  • 6,386
  • 27
  • 127
  • 202
0
votes
2 answers

asp.net webgrid header formatting and paging issue

I am using the aspx view engine with asp.net MVC 3. I have a WebGrid control that displays my selected records and pages through the selected records properly. Clicking on field header also sorts the data. The problems: If am on page two and I…
user20358
  • 14,182
  • 36
  • 114
  • 186
0
votes
3 answers

MVC3 WebGrid CheckBox

I'm trying to add a checkbox to a column on a web grid, and I'm finding it hard using Html.CheckBox to get it to render. If I use input type="checkbox" it renders, but I can't seem to save the value in the view model. I have a rather complex view,…
Mark
  • 315
  • 2
  • 8
  • 24
0
votes
1 answer

MVC3 WebGrid Row Select Checkbox

I searched all over and can't seem to find the answer. I have a MVC3 project with a WebGrid on it. The first column is a Select that is currently using the normal item.GetSelectLink to create a link to select that row. I want this to be a checkbox…
user856232
  • 1,073
  • 2
  • 14
  • 40
0
votes
2 answers

How to insert a new line into database and read value onto my webgrid in razor MVC 3

I am using Razor, MVC3 with Poco entities. While inserting into the database I am using Enviroment.NewLine as a seperator between two texts. oldValues += " Name = '" + oldName.Name + "'" + Environment.NewLine ; oldValues += " Age = '" +…
Yasser Shaikh
  • 46,934
  • 46
  • 204
  • 281
0
votes
1 answer

webgrid show the paging even if there is only one page

I am using the Webgrid in asp.net mvc3, and using it's build in paging and sorting. @{ var grid = new WebGrid(rowsPerPage: 10, ajaxUpdateContainerId: "GridDiv"); grid.Bind(source: Model); grid.Pager(WebGridPagerModes.All); } The paging…
Y2theZ
  • 10,162
  • 38
  • 131
  • 200
-1
votes
1 answer

How to make columns visible false while using WebGrid Helper

I am using @grid.GetHtml gridview to show the grid in my ASP.NET MVC4 application. I want to visible some columns in my grid view and also i will use these columns for my future functionality. Please help how to make the columns as visible false in…
Sup
  • 3
  • 6
-1
votes
1 answer

How to delete multiple records in a webgrid by clicking a delete button which is declared in a partial view in MVC

I have declared the webgrid inside a div in a partial view and my delete button is in Main View.Now I want a functionality in which when i click the delete button my webgrid should get refreshed only not whole page(Main View). **I want to refresh…
Basant Gera
  • 103
  • 3
  • 16
-1
votes
1 answer

How to delete multiple records in webgrid without refreshing whole page in MVC? Only Webgrid should refresh

I am making Some functionalities in my webgrid. When I select one or more than one checkbox to delete the data my page get refreshed.I wanted to have functionality in which My webgrid should refresh not all the webpage. Please help me guys.An link…
-1
votes
1 answer

How to insert condition IF in WebGridColumn

I have this view View @model IEnumerable @{ var idGrid = "grid" + this.ViewBag.IdParameters ?? string.Empty; var grid = new WebGrid(id: idGrid, rowsPerPage: this.RowsPerPage, ajaxUpdateContainerId: idGrid); byte Status =…
O Aprendiz
  • 55
  • 3
  • 13
-1
votes
3 answers

Change WebGrid cell into textbox form

I have a dataset and I'm required to display it in a Web Application. Here is what the dataset looks like: Point_ID Project No. Project Manager Comments A007 1304 Oscar Duran Found destroyed A008 1304 …
Oscar Duran
  • 117
  • 2
  • 14
-1
votes
1 answer

Get table td input values corresponding to id

i need to change value for all td's how can i all td under tr i have DISReferralId 27 ... by this id how to filter code : 42423 Etet…
Bharathi Devarasu
  • 7,759
  • 2
  • 18
  • 23
1 2 3
54
55