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 OriginalGriff 365
1 Sergey Alexandrovich Kryukov 334
2 CPallini 275
3 DamithSL 230
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,457
2 Maciej Los 3,885
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,115


Advertise | Privacy | Mobile
Web04 | 2.8.141216.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