Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. @model IEnumerable<UserManager.Models.vw_UserManager_Model>
  2. @{WebGrid grid = new WebGrid(Model, canPage: true, canSort: true, rowsPerPage: 15, selectionFieldName: "selectedRow", fieldNamePrefix: "gridItem");}
  3. <b>@Html.Label("Total number of records displayed: ")</b>
  4. @Html.Label(grid.TotalRowCount.ToString())
  5. @grid.GetHtml(
  6. fillEmptyRows: true,
  7. tableStyle: "webgrid",
  8. alternatingRowStyle: "webgrid-alternating-row",
  9. headerStyle: "webgrid-header",
  10. footerStyle: "webgrid-footer",
  11. selectedRowStyle: "webgrid-selected-row",
  12. rowStyle: "webgrid-row-style",
  13. mode: WebGridPagerModes.All,
  14. columns: new[] {
  15. grid.Column("UserName"),
  16. grid.Column("salutation"),
  17. grid.Column("FirstName"),
  18. grid.Column("LastName"),
  19. grid.Column("Password"),
  20. grid.Column(header: "Session Status", canSort: true, format: @<text><input name="User logged in"
  21. type="checkbox" @(item.session_status == 1 ? "Checked" : null) onclick="logUserOff('@Url.Action("LogUserOff", "UserManager", new {userid = item.userid} )')" id="chkboxIsActive" /></text>),
  22. grid.Column("isactive"),
  23. //grid.Column("isapproved"),
  24. grid.Column("MaxConcurrentUsers"),
  25. grid.Column("email"),
  26. grid.Column("group_name"),
  27. grid.Column("module_name"),
  28. grid.Column(header:"Edit", format:@<text><div id="btnEditSelectedRow">
  29. @Html.ActionLink("Edit record", "EditUser", "UserManager", new {
  30. userid = item.userid,
  31. salutation = item.salutation,
  32. firstname = item.FirstName,
  33. lastname = item.LastName,
  34. password = item.Password,
  35. isactive = item.isactive,
  36. isapproved = item.IsApproved,
  37. maxconcurrentusers = item.MaxConcurrentUsers,
  38. email = item.email,
  39. rowtype = item.rowtype,
  40. module = item.module_name,
  41. group = item.group_name }, null)</div></text>),
  42.  
  43. grid.Column(header:"Delete", format:@<text><div id="btnDelSelectedRow">
  44. @Html.ActionLink("Delete record", "DeleteUser", "UserManager", new {
  45. userid = item.userid,
  46. username = item.UserName,
  47. salutation = item.salutation,
  48. firstname = item.FirstName,
  49. lastname = item.LastName,
  50. password = item.Password,
  51. isactive = item.isactive,
  52. email = item.email,
  53. module = item.module_name,
  54. rowtype = item.rowtype,
  55. group = item.group_name }, null)</div></text>),
  56. })
  57.  
  58. .webgrid
  59. {
  60. width: 500px;
  61. border: 0px;
  62. border-collapse: collapse;
  63. oveflow:scroll auto;
  64. }
  65.  
  66. .webgrid a
  67. {
  68. color: #000;
  69. }
  70.  
  71. .webgrid-header
  72. {
  73. padding: 6px 5px;
  74. text-align: center;
  75. background-color: #e8eef4;
  76. border-bottom: 2px solid #3966A2;
  77. height: 40px;
  78.  
  79. border-top: 2px solid #D6E8FF;
  80. border-left: 2px solid #D6E8FF;
  81. border-right: 2px solid #D6E8FF;
  82. }
  83.  
  84. .webgrid-footer
  85. {
  86. padding: 6px 5px;
  87. text-align: center;
  88. background-color: #e8eef4;
  89. border-top: 2px solid #3966A2;
  90. height: 30px;
  91.  
  92. border-bottom: 2px solid #D6E8FF;
  93. border-left: 2px solid #D6E8FF;
  94. border-right: 2px solid #D6E8FF;
  95. }
  96.  
  97. .webgrid-alternating-row
  98. {
  99. height: 30px;
  100. background-color: #f2f2f2;
  101. border-bottom: 1px solid #d2d2d2;
  102.  
  103. border-left: 2px solid #D6E8FF;
  104. border-right: 2px solid #D6E8FF;
  105. }
  106.  
  107. .webgrid-row-style
  108. {
  109. height: 30px;
  110. border-bottom: 1px solid #d2d2d2;
  111.  
  112. border-left: 2px solid #D6E8FF;
  113. border-right: 2px solid #D6E8FF;
  114. }
  115.  
  116. .webgrid-selected-row
  117. {
  118. font-weight: bold;
  119. }
  120.  
  121. .content-wrapper {
  122. margin: 0 auto;
  123. max-width: 960px;
  124. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement