Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model CRM.ViewModels.GridList<CRM.Models.AaaUser>
- var gridcolumns = new List<WebGridColumn>();
- gridcolumns.Add(new WebGridColumn()
- {
- ColumnName = "SDUser.Department.Definition.DEPTNAME",
- Header = Html.DisplayNameFor(model => model.Content.FirstOrDefault().SDUser.Department.Definition.DEPTNAME).ToString(),
- CanSort = true
- });
- //code goes here for others `WebGridColumn`.....
- var grid = new WebGrid(
- canPage: true,
- rowsPerPage: Model.PageSize,
- canSort: true,
- ajaxUpdateContainerId: "grid");
- grid.Bind(Model.Content, rowCount: Model.TotalRecords, autoSortAndPage: false);
- grid.Pager(WebGridPagerModes.All);
- @grid.GetHtml(htmlAttributes: new { id = "grid" }, // id for ajaxUpdateContainerId parameter
- fillEmptyRows: false,
- tableStyle: "table table-bordered table-hover",
- mode: WebGridPagerModes.All,
- columns: gridcolumns
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement