webgrid

post items of webgrid asp.net mvc3

匆匆过客 提交于 2019-12-19 03:52:09
问题 I have these DTO's public class Header { public int HeaderId{get;set;} public int Description{get;set;} public List<HeaderItem> HeaderItems{get;set;} } public class HeaderItem { public int HeaderItemId{get;set;} public string DetailDescription{ get; set; } public bool Selected{ get; set; } } and I have this Controller [HttpPost] public ActionResult PostMethod(Header dto) { ... } and this html @using (Html.BeginForm("PostMethod", "Controller", FormMethod.Post, new { id = "form" })) { @Html

ASP.NET MVC3 WebGrid format: parameter

老子叫甜甜 提交于 2019-12-18 19:08:41
问题 I am trying to use the new WebGrid in ASP.NET MVC3 and one of the columns I want to display set of link icons that performs various actions (Edit, View, Delete)... For this purpose I have a HtmlHelper extensions that basically outputs following HTML: <a href="" title=""><img alt="" src="" /></a> The extension returns MvcHtmlString and it works fine when used in Razor views by itself..Eg: @Html.ActionLinkIconForEditAction("Customer", 2) The issue is I need to invoke this helper (once for each

ASP.NET MVC3 WebGrid format: parameter

百般思念 提交于 2019-12-18 19:08:06
问题 I am trying to use the new WebGrid in ASP.NET MVC3 and one of the columns I want to display set of link icons that performs various actions (Edit, View, Delete)... For this purpose I have a HtmlHelper extensions that basically outputs following HTML: <a href="" title=""><img alt="" src="" /></a> The extension returns MvcHtmlString and it works fine when used in Razor views by itself..Eg: @Html.ActionLinkIconForEditAction("Customer", 2) The issue is I need to invoke this helper (once for each

Paging/Sorting not working on web grid used in Partial View

≡放荡痞女 提交于 2019-12-18 04:28:22
问题 I have a partial view where I am showing a web grid depending upon a value selected from a page. For drop down I have used @Html.DropDownListFor( x => x.ItemId, new SelectList(Model.Items, "Value", "Text"), new { id = "myddl", data_url = Url.Action("Foo", "SomeController") } ) For drop down item select I have used $(function() { $('#myddl').change(function() { var url = $(this).data('url'); var value = $(this).val(); $('#result').load(url, { value: value }) }); }); and below is my action

Bind WebGrid form AJAX

血红的双手。 提交于 2019-12-17 18:48:11
问题 I'm a newbie to MVC3 and Razor and I need help on binding/loading a WebGrid once data is returned from AJAX post. Any help would really be appreciated (project due date quickly approaching) ;) My scenario is this: I have two cascading drop down lists. The first list contains the regions from the database. Once a region is selected it populates the second drop down with a list of facilities. Once a facility is selected I need to populate a WebGrid with a list of buildings. I have the cascading

MVC WebGrid, row select

匆匆过客 提交于 2019-12-13 17:17:03
问题 I have simple WebGrid with item: grid.Column(format: (item) => @Ajax.ActionLink("Select", "LoadForEdit", "Receipt", new { Id = Model.Services.IndexOf(@item.Value) }, new AjaxOptions { UpdateTargetId = "ItemToEdit" })) And i want to select when actually clicking on row, not only on 'select' item in that row. Is it possible? 回答1: I wrote an article on making WebGrid rows "clickable" for Razor Web Pages (http://www.mikesdotnetting.com/Article/178/How-To-Make-A-WebGrid-Row-Clickable) using jQuery

MVC Razor WebGrid Get Selected Row on Button Submit

不打扰是莪最后的温柔 提交于 2019-12-13 04:33:48
问题 How can i get WebGrid Selected Row into Hidden Variable. I am using the following code. @{ var grid = new WebGrid(@ViewBag.ImageFiles, canPage: false, rowsPerPage: 5, selectionFieldName: "SelectedRow", ajaxUpdateContainerId: "gridImages"); } <div id="gridContent"> @grid.GetHtml(tableStyle: "webGrid", htmlAttributes: new { id = "gridImages" }, headerStyle: "header", displayHeader: true, alternatingRowStyle: "alt", selectedRowStyle: "select", columns: grid.Columns( grid.Column("Select", format:

Strange Entity Framework behaviour - caching?

北慕城南 提交于 2019-12-13 02:58:55
问题 I have ASP.NET MVC 4 appliation using EF 4.3 with migrations. I use a WebGrid Helper to display details for system users: @grid.GetHtml( headerStyle: "gridHeader", footerStyle: "gridFooter", firstText: "<< First", previousText: "< Previous", nextText: "Next >", lastText: "Last >>", alternatingRowStyle: "gridAlternativeRow", columns: new[] { grid.Column("Login", header: "User Login", canSort: true), grid.Column("FullName", header: "User Name", canSort: true), grid.Column("Email", header: "User

format a webgrid in mvc4 with html helper

丶灬走出姿态 提交于 2019-12-13 02:21:59
问题 I have the following web grid. selectionFieldName: "selectedRow", ajaxUpdateContainerId: "gridContent"); grid.Pager(WebGridPagerModes.NextPrevious);} <div id="gridContent"> @grid.GetHtml(tableStyle: "webGrid", headerStyle: "header", alternatingRowStyle: "alt", selectedRowStyle: "select", columns: grid.Columns( grid.Column("TaskID", "TaskID"), grid.Column("TaskDesc", " Task Desc", format: @Html.Raw(task.TaskDesc)), grid.Column("TaskTitle", "Task Title", style: "description") )) This line :

Cannot convert from 'lambda expression' to 'system.func dynamic object ' MVC3 Razor

左心房为你撑大大i 提交于 2019-12-12 22:37:29
问题 I'm getting the mentioned error and "Invalid arguments" for WebGrid.column error in my view page. //View @{ WebGrid grid = new WebGrid(Model.LoadProductDetails()); @grid.GetHtml( tableStyle: "grid", fillEmptyRows: false, headerStyle: "gvHeading", alternatingRowStyle: "gvAlternateRow", rowStyle: "gvRow", footerStyle: "gvFooter", mode: WebGridPagerModes.All, firstText: "<< First", previousText: "< Prev", nextText: "Next >", lastText: "Last >>", columns: new[] { grid.Column("ProductId",header: