This article appears in the Third Party Products and Tools section. Articles in this section are for the members only and must not be used to promote or advertise products in any way, shape or form. Please report any spam or advertising.
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MvcApplication1.Models.CustomerModel>>" %> <%@ Import Namespace="Telerik.Web.Mvc.UI" %> <asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server"> </asp:Content> <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server"> <script type="text/javascript"> function overrideFilterClick() { var grid = $('#CustomerGrid').data('tGrid'); var filterClick = grid.filterClick; grid.filterClick = function() { $.each(this.columns, function() { this.filters = []; }); filterClick.apply(this, arguments); } } function applyFrozenColumns() { $('#CustomerGrid').freezeGridColumn(2); } </script> <div class="grid"> <% Html.Telerik().Grid(Model) .Name("CustomerGrid") .Columns(columns => { columns.Bound(c => c.Title).Width(80); columns.Bound(c => c.FirstName).Width(280); columns.Bound(c => c.LastName).Width(180); columns.Bound(c => c.Address).Width(180); columns.Bound(c => c.Suburb).Width(180); columns.Bound(c => c.State).Width(180); columns.Bound(c => c.Postcode).Width(180); columns.Bound(c => c.Email).Width(180); columns.Bound(c => c.Mobile).Width(180); columns.Bound(c => c.Telephone).Width(180); columns.Bound(c => c.Fax).Width(180); columns.Bound(c => c.Title).ClientTemplate("<span></span>").Visible(true).Title(" "); }) .Sortable(sorting => sorting.SortMode(GridSortMode.SingleColumn)) .DataBinding(binding => binding.Ajax().Select("GetCustomers", "Home")) .Scrollable(scrolling => scrolling.Height(150)).Render(); %> <% Html.Telerik().ScriptRegistrar().OnDocumentReady("overrideFilterClick();"); %> <% Html.Telerik().ScriptRegistrar().OnDocumentReady("applyFrozenColumns();"); %> </div> </asp:Content>
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)