/ Published in: C#
URL: http://mvccontrib.codeplex.com/wikipage?title=Grid&referringTitle=Documentation
Example usage
Expand |
Embed | Plain Text
<div> <%= Html.Grid<ReportingGroup>("reportingGroups") .Sort(ViewData["sort"] as GridSortOptions) .RowAttributes( @title => String.Format("Recipients:{0} Creator:{1} Customer Reporting Name:{2} Number of Configured Items:{3}", data.Item.ReportingGroupRecipientsAsString, data.Item.CreatorEmailAddress, data.Item.ReportingGroupName, data.Item.ReportingGroupItems.Count ) ) ) .Columns(column => { column.For(x => x.Id).Attributes(@class => "report-id").Sortable(true); column.For(x => x.ReportingGroupRecipientsForGrid(40)).Named("Recipients").Attributes(@class => "report-recipients").Sortable(false); column.For(x => x.CreatorEmailAddress).Named("Creator").Attributes(@class => "report-creator").Sortable(true); column.For(x => x.ReportingGroupName).Named("Customer Reporting Name").Attributes(@class => "report-name").Sortable(true); column.For(x => "<a href=\"" + Url.Action("Edit", "ReportingGroup", new { id = x.Id }) + "\" class=\"edit-link\"><img src=\"" + Url.Content("~/Content/images/pencil.png") + "\"/></a>").Named("Edit").Sortable(false).DoNotEncode().Attributes(@class => "report-link-cell"); column.For(x => "<a href=\"" + Url.Action("ConfirmDelete", "ReportingGroup", new { id = x.Id }) + "\" class=\"delete-link\"><img src=\"" + Url.Content("~/Content/images/bin_closed.png") + "\"/></a>").Named("Delete").Sortable(false).DoNotEncode().Attributes(@class => "delete-link-cell"); }) .Empty("No reporting preferences have been found for your user ID.") %> <%= Html.Pager("reportingGroups") %> </div>
You need to login to post a comment.
