Click here to Skip to main content
15,314,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,
I want to display database data using webgrid and checkbox.(ASSEST MANAGEMENT FLG", )Please help.

HTML
@model IEnumerable<hrms_dl.zbs_hr_emp_noncash_benefit>

@{
    Layout = null;
}

@{   
    var grid = new WebGrid(Model, rowsPerPage: 2, ajaxUpdateContainerId: "myGrid");
    @grid.GetHtml(columns: grid.Columns(
    grid.Column("ASSEST MANAGEMENT FLG", format: (col) => @Html.CheckBox("<input type='checkbox' checked='" + ((col.ENBEN_ASSES_MGMT_FLG==true) ? "checked" : "") + "' disabled='true' />")),
    grid.Column(format: (item) => Html.ActionLink("Edit", "Edit", new { id = item.EMP_NC_CODE, area = "EIM" }, new { style = "color:Blue" })),
    grid.Column(format: (item) => Html.ActionLink("Details", "Details", new { id = item.EMP_NC_CODE, area = "EIM" }, new { style = "color:Blue" }))
                                      ));
}</hrms_dl.zbs_hr_emp_noncash_benefit>
Posted
Updated 9-Sep-12 18:24pm
v2

1 solution

Hi,
I found the solution by myself.


grid.Column(header: "", format: @<text><input name="chkUserAdminGroup" type="checkbox" value="@item.ENBEN_ASSES_MGMT_FLG" @(item.ENBEN_ASSES_MGMT_FLG == false ? null : "checked") /></text>),
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900