Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q1 2012 released 04/11/2012
select
  • Rate / Review
    • Give your Feedback:

      Rate this demo:


Grid / Styling Header, Footer and Pager


Customer IDCompany NameContact NameContact TitleAddressPostal Code
      
Change page: First Page Previous PageNext Page Last Page
 Page 1 of 13, items 1 to 7 of 91.
ALFKIAlfreds FutterkisteMaria AndersSales RepresentativeObere Str. 5712209
ANATRAna Trujillo Emparedados y heladosAna TrujilloOwnerAvda. de la Constitución 222205021
ANTONAntonio Moreno TaqueríaAntonio MorenoOwnerMataderos 231205023
AROUTAround the HornThomas HardySales Representative120 Hanover Sq.WA1 1DP
BERGSBerglunds snabbköpChristina BerglundOrder AdministratorBerguvsvägen 8S-958 22
BLAUSBlauer See DelikatessenHanna MoosSales RepresentativeForsterstr. 5768306
BLONPBlondesddsl père et filsFrédérique CiteauxMarketing Manager24, place Kléber67000



  • If you applied some of the predefined skins for the control (for example the Default skin), you can easily model the look and feel for the grid's header/footer/pager items through the th.GridHeader_[SkinName], GridFooter_[SkinsName] and GridPager_[SkinName] classes (residing in the RadControls/Grid/Skins/[SkinsName]/Styles.css file).
    Below we present their structure for the Default grid skin:

    th.GridHeader_Default,
    th.ResizeHeader_Default
    {
    font: bold 10px Verdana, Arial, Sans-serif;
    background: white url('Img/GridHeaderBg.gif') repeat-x bottom;
    border-top: solid 1px #e5e5e5;
    border-bottom: solid 1px #bbb;
    padding-left: 6px; /*more than items to compensate for item borders!*/
    height: 22px;
    /*add more definitions if needed*/
    }
    .GridPager_Default td
    {
    background: white;
    border: solid 1px white;
    border-top: 1px solid #c7c7c7;
    height: 21px;
    color: #999;
    padding-left: 4px;
    /*add more definitions if needed*/
    }
    .GridFooter_Default td
    {
    background: #fbfbfb;
    border: solid 1px #fbfbfb;
    border-top: 1px solid #e8e6e6;
    height: 21px;
    color: #666;
    padding-left: 4px;
    /*add more definitions if needed*/
    }

    Additional details about how to modify the existing grid skins you can find in this article from the product online documentation:
    Modify existing skins

    Moreover, the appearance of the Header, Footer and Pager in Telerik RadGrid can be fully customized using the respective properties of the component - HeaderStyle, FooterStyle and PagerStyle (when no skin is applied). In the paragraph below you will find a code snippets fetched from the ASPX of the page and the Styles.css file (placed in the NET2\Grid\Examples\Styles\HeaderFooterPagerStyles subfolder of the grid installation folder:

    <PagerStyle CssClass="RadGridPager" Mode="NumericPages"></PagerStyle> <HeaderStyle CssClass="RadGridHeader"></HeaderStyle> <FooterStyle CssClass="FooterStyle"></FooterStyle>

    Styles.css

    .RadGridHeader
    {
    height: 59px;
    padding: 0px;
    color: #819598;
    font-weight: bold;
    font-size: 16px;
    padding-left: 4px;
    }

    .RadGridHeader A, .RadGridHeader SPAN
    {
    padding-top: 14px;
    display: block;
    text-decoration: none;
    font-weight: bold;
    }

    .RadGridHeader A:hover
    {
    text-decoration: underline;
    }

    .FooterStyle
    {
    height: 6px;
    line-height: 4px;
    font-size: 0px;
    }

    .FooterStyle TD
    {
    border-left: 7px solid #d2b6c1;
    border-right: 7px solid #d2b6c1;
    }

    .RadGridPager
    {
    background-image: url(img/footer.gif);
    background-repeat: repeat-x;
    height: 51px;
    padding-left: 11px;
    background-color: white;
    vertical-align: bottom;
    color: #b79ea9;
    font-weight: bold;
    }

    .RadGridPager A
    {
    color: #b79ea9;
    }

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="vb" AutoEventWireup="false" Inherits="Telerik.GridExamplesVBNET.Styles.HeaderFooterPagerStyles.DefaultVB" CodeFile="DefaultVB.aspx.vb" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <telerik:HeadTag runat="server" ID="Headtag2"></telerik:HeadTag>
        <link href="Styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
            <telerik:Header runat="server" ID="Header1" NavigationLanguage="VB" ShowSkinChooser="false"></telerik:Header>
            <!-- content start -->
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
                <br/>
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="RadGrid1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>            
                <telerik:RadGrid id="RadGrid1" DataSourceID="SqlDataSource1" CssClass="RadGrid" runat="server" AllowPaging="True" AllowSorting="True"
                    GridLines="None" PageSize="7" Width="95%" Skin="">
                    <PagerStyle CssClass="RadGridPager" Mode="NextPrev"></PagerStyle>
                    <HeaderStyle CssClass="RadGridHeader"></HeaderStyle>
                    <ItemStyle CssClass="RadGridItem"></ItemStyle>
                    <AlternatingItemStyle CssClass="RadGridItem"></AlternatingItemStyle>
                    <GroupHeaderItemStyle BorderColor="Black" BackColor="Silver"></GroupHeaderItemStyle>
                    <MasterTableView ShowFooter="True" Width="100%"></MasterTableView>
                </telerik:RadGrid>
                <br />
                <br />
    <asp:SqlDataSource ID="SqlDataSource1"
    ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"

                ProviderName="System.Data.SqlClient"
                SelectCommand="SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, PostalCode FROM Customers"
                runat="server"></asp:SqlDataSource>
            <!-- content end -->
            <telerik:Footer runat="server" ID="Footer1"></telerik:Footer>
        </form>
    </body>
    </html>

Get more than expected!

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2012 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451