How To Change Pager Style of GridView

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mudassir
    New Member
    • May 2012
    • 85

    How To Change Pager Style of GridView

    Let us try to change the default pager style of the GridView.The default pager style is 1 2 3 4..

    Let us make it First Previous Next Last.

    For that first of all write a simple css like
    Code:
      <style type="text/css">
            .cssPager td
            {
                background-color: #CCC;
                font-size: 18px;
                padding-left: 4px;
                padding-right: 4px;
            }
        </style>
    Now let us see how we will write the GridView to change the pager style, the markup or grid view will be like this:
    Code:
    <asp:GridView ID="gvPager" runat="server" AutoGenerateColumns="False" Width="100%"
                        AllowPaging="True" OnPageIndexChanging="gvPager_PageIndexChanging" PageSize="5" EmptyDataText ="No Records Found">
                        <PagerStyle CssClass="cssPager" />
                        
    <PagerSettings Mode="NextPreviousFirstLast" PageButtonCount="4" PreviousPageText="Previous" NextPageText="Next" FirstPageText="First" LastPageText="Last" />
    <Columns>
    .
    .
    .
    .
    </Columns>
     </asp:GridView>
    Chillas
    Addan
    Last edited by Frinavale; Aug 2 '12, 02:46 PM. Reason: Fixed grammar.
Working...