How to display Check Box or DropDownList in Webgrid
In WebGrid
grid.Columns(
grid.Column("", header: null, format: @<text> @Html.ActionLink("Select", "Edit", new { id = item.BranchID })</text>),
grid.Column("BranchCode", header: "Branch Code", style: "col-01"),
grid.Column("BranchName", header: "Branch Name" + ITManagementSystem.Models.Helper.SortDirection(null, ref grid, "BranchName"), style: "col-02"),
grid.Column("BranchAddress", header: "Branch Address", style: "col-04"),
grid.Column("CompanyName", header: "Company Name", style: "col-02"),
grid.Column("BranchContactNo", header: "Contact No", style: "col-01"),
grid.Column("BranchContactPerson", header: "Contact Person", style: "col-01"),
grid.Column(header:"Is Active?", format:@<text><input type="checkbox"/></text>),
grid.Column(header: "Status", format:@<span>@Html.DropDownList("value", new List<SelectListItem>{
new SelectListItem{Text="All", Value="0",Selected=true},
new SelectListItem {Text="Yes", Value="1"},
new SelectListItem {Text="No", Value="2"}
} )

Comments
Post a Comment