本文介绍了如何在没有提交表格的情况下将Webgrid绑定到下拉列表中的选定索引在Mvc 4中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




@Html.DropDownListFor(model => model.Cbranch_courseCode, ViewData["ddlCourse"] as List<SelectListItem>, "--Select Course Group--", new { @class = "form-control",required = "required" })










@{
                   var grid = new WebGrid(Model.listCbranchmasters, canPage: true, rowsPerPage: 5, 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("Cbranch_code", "ID"),
                                       //grid.Column("Bank Name",format: (item) => item.GetSelectLink(item.Bbranch_eName)),
                                       grid.Column("Course_GroupName_E", "Course Group Name",style: "description"),
                                       grid.Column("Cbranch_eName", "Course Branch Name(English) "),
                                       grid.Column("Cbranch_hName", "Course Branch Name(Hindi)"),
                                       grid.Column("Cbranch_length_in_year", "Course Duaration"),
                                       grid.Column("Cbranch_Type", "Course Type"),
                                       grid.Column("Edit",format: @<text><a href="/Admin/[email protected]_code"><img src="~/Content/Image/Text-Edit.png" /></a></text>)
                                 ))

推荐答案


这篇关于如何在没有提交表格的情况下将Webgrid绑定到下拉列表中的选定索引在Mvc 4中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 09:59