Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MVC3
Hi ,
I want to display database data using webgrid and checkbox.(ASSEST MANAGEMENT FLG", )Please help.
 
@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 9-Sep-12 19:21pm
Edited 9-Sep-12 19:24pm
JF201553.3K
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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>),
 

  Permalink  

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

  Print Answers RSS
0 BillWoodruff 330
1 Mathew Soji 309
2 Maciej Los 295
3 Afzaal Ahmad Zeeshan 257
4 DamithSL 225
0 OriginalGriff 6,369
1 Sergey Alexandrovich Kryukov 5,973
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 4,045


Advertise | Privacy | Mobile
Web02 | 2.8.1411019.1 | Last Updated 10 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100