webgrid

Simple MVC web grid issue. I just want to add a unique id to each row in a table

删除回忆录丶 提交于 2021-01-29 04:10:29
问题 Somebody proposed this answer: mvccontrib grid - How to add <tr> id is there an elegant way? I have a table like the following: My problem I just want to add a unique id to each row in this table Detailed explanation of the problem <tr class="webgrid-row-style"> I actually want @item.MvrMedsDetailsId.ToString() which is a dynamic value to be set in the row id. Like this: <tr class="webgrid-row-style" id=@item.MvrMedsDetailsId.ToString()> should yield for each row in the table <tr class=

Can't get past “A jquery script reference is required in order to enable Ajax support in the ”WebGrid“ helper”

瘦欲@ 提交于 2020-01-16 04:16:24
问题 I am having a similar as the user here: ASP.NET MVC 3.0 WebGrid - Ajax Enabled and here: http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/22be0501-1b0b-496a-9d0c-f9f5138996ac However none of the suggestions from those threads is helping here. The specifics: When running in my local debugger on my Windows 7/IIS 8 machine, I am getting the 'A jQuery script reference is required in order to enable Ajax support in the "WebGrid" helper' message after an ajax postback trying to

MVC 3 Razor- how to bind new model to webgrid using jQuery ajax

假装没事ソ 提交于 2020-01-16 00:24:44
问题 I have an issue with updating my webgrid with a new model which is returned from my DAL. On my view I have checkboxes used to filter data displayed on the grid. Once a checkbox is ticked this calls some jQuery ajax function which passes the checkbox values to my method in my controller. This then calls my DAL and it returns a new list of my model with the correct values. I return this list to my view but when the page loads nothing is different. The grid looks the same which isn't what I

ASP.NET MVC WebGrid is not properly passing current parameters to the pagination links in a particular situation

老子叫甜甜 提交于 2020-01-13 19:08:47
问题 WebGrid pagination links work properly in all cases, except one (that I noticed). When you use CheckBoxFor in MVC, it creates an input[type=hidden] and an input[type=check-box] for the same field so that it can handle state. So, if you have a field named X and submit your form in the GET method, you will end up with an URL like this: http://foo.com?X=false&X=true The default model binder can understand these multiple instances os X and figure out it's value. The problem occurs when you try to

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

青春壹個敷衍的年華 提交于 2020-01-06 15:29:11
问题 I have used a WebGrid in my asp.net mvc4 application <td > @grid.GetHtml(tableStyle:"table_div", headerStyle:"table_header", columns: grid.Columns( grid.Column("Nom de la propriété","Nom de la propriété",canSort:false,format:@<label>@Html.Raw(@item.PName)</label>), grid.Column("Valeur de la propriété","Valeur de la propriété",canSort:false,format:@<label>@Html.Raw(@item.PName)</label>), grid.Column("","",canSort:false,format:@<span>@{i++;<input name="proper@(@i)" type="checkbox" />}</span>)))

Binding MVC WebGrid column to source's dictionary property value

安稳与你 提交于 2020-01-06 04:24:06
问题 I'm using MVC's WebGrid throughout my application and it's been working great. I'm setting the columns for the grid in my controller code and then passing that to my view. I add a new column like this where columns is a List<MvcWebGridColumn> : columns.Add(new WebGridColumn { ColumnName = "Path", Header = "Full Path", Filter = ... }); And then in my view, I set the grid columns from my view model like this: @grid.GetHtml( footerStyle: "hide", mode: WebGridPagerModes.All, htmlAttributes: new {

Refer to an other columns value in a MVC3 Razor WebGrid

℡╲_俬逩灬. 提交于 2020-01-06 04:20:28
问题 I have a webgrid presenting data grouped by weeks. The first grid column contains the weeknumber as seen below in the code example. The last "Summary" column needs to show different content depending on if the rows weeknumber match the current weeknumber or not. Is it possible to use the Weeknumber column value from them Summary column in some way? @grid.GetHtml(tableStyle: "grid", headerStyle: "head",columns: trainingGrid.Columns( grid.Column("WeekNumber", "Week"), ..... grid.Column("Summary

asp.net mvc 3 webgrid bound to List<dynamic> is exceedingly slow

心已入冬 提交于 2020-01-06 02:25:48
问题 I need to display a data table that can return a variable number of columns in a view, so I am binding an Mvc 3 WebGrid to a List<dynamic>, as described in the answer to this post: Populate MVC Webgrid from DataTable It works fine, but is incredibly slow! By "incredibly slow" I mean it takes 13 seconds to display a set of 15 records with 11 columns. Is there any way to speed this up? I've tried removing the Pager but that has no effect. The code that creates the List<dynamic> from an Ado.Net

use images instead of text in webgrid asp mvc

为君一笑 提交于 2020-01-04 08:05:31
问题 How can I change the action links in this webgrid into images? ps: I want all the images to appear in the same column @{ var grid = new WebGrid(Model, canPage:true ,canSort:true, rowsPerPage :6); grid.Pager(WebGridPagerModes.NextPrevious); @grid.GetHtml(tableStyle: "webGrid", htmlAttributes: new { id = "datatable" }, headerStyle: "Header", alternatingRowStyle: "alt", columns: grid.Columns(grid.Column(header: "", format: (item) => new HtmlString( Html.ActionLink("Détails", "Details", new { id

MVC WebGrid - How to programatically get the current page, sort column etc

风格不统一 提交于 2020-01-01 16:06:15
问题 How can I programatically (in javascript) get the current page number, last sort column and sort direction of the ASP.NET MVC WebGrid? Is it possible to update the arguments before it calls the $("#grid").load() method? 回答1: The only possible solution was to use jQuery to retrieve: - the "href" attribute from the first column header to get the page number and - the "href" attribute from the "next page number" to get the sort column and sort directions. function reloadGrid(form) { var grid =