|
| 1 | +<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<IEnumerable<OrderDto>>" %> |
| 2 | +<%@ Import Namespace="Project.Namespace.To.Models" %> |
| 3 | + |
| 4 | +<asp:content contentplaceholderid="maincontent" runat="server"> |
| 5 | +<% using (Html.Configurator("The grid should...") |
| 6 | + .PostTo("FirstLook", "Grid") |
| 7 | + .Begin()) |
| 8 | + { %> |
| 9 | + <ul> |
| 10 | + <li><%= Html.CheckBox("ajax", true, "make <strong>AJAX</strong> requests")%></li> |
| 11 | + <li><%= Html.CheckBox("grouping", true, "allow <strong>grouping</strong> of data")%></li> |
| 12 | + <li><%= Html.CheckBox("filtering", true, "allow <strong>filtering</strong> of data")%></li> |
| 13 | + <li><%= Html.CheckBox("paging", true, "have <strong>pages</strong> with 10 items")%></li> |
| 14 | + <li><%= Html.CheckBox("scrolling", true, "show a <strong>scrollbar</strong> when there are many items")%></li> |
| 15 | + <li><%= Html.CheckBox("sorting", true, "allow <strong>sorting</strong> of data")%></li> |
| 16 | + <li><%= Html.CheckBox("showFooter", true, "show footer")%></li> |
| 17 | + </ul> |
| 18 | + <button class="t-button t-state-default" type="submit">Apply</button> |
| 19 | +<% } %> |
| 20 | + |
| 21 | +<%= Html.Telerik().Grid(Model) |
| 22 | + .Name("Grid") |
| 23 | + .Columns(columns => |
| 24 | + { |
| 25 | + columns.Bound(o => o.OrderID).Width(100); |
| 26 | + columns.Bound(o => o.ContactName).Width(200); |
| 27 | + columns.Bound(o => o.ShipAddress); |
| 28 | + columns.Bound(o => o.OrderDate).Format("{0:MM/dd/yyyy}").Width(120); |
| 29 | + }) |
| 30 | + .DataBinding(dataBinding => |
| 31 | + { |
| 32 | + dataBinding.Server().Select("FirstLook", "Grid", new { ajax = ViewData["ajax"] }); |
| 33 | + dataBinding.Ajax().Select("_FirstLook", "Grid").Enabled((bool)ViewData["ajax"]); |
| 34 | + }) |
| 35 | + .Scrollable(scrolling => scrolling.Enabled((bool)ViewData["scrolling"])) |
| 36 | + .Sortable(sorting => sorting.Enabled((bool)ViewData["sorting"])) |
| 37 | + .Pageable(paging => paging.Enabled((bool)ViewData["paging"])) |
| 38 | + .Filterable(filtering => filtering.Enabled((bool)ViewData["filtering"])) |
| 39 | + .Groupable(grouping => grouping.Enabled((bool)ViewData["grouping"])) |
| 40 | + .Footer((bool)ViewData["showFooter"]) |
| 41 | +%> |
| 42 | +</asp:content> |
0 commit comments