Stylish Gridview with stylish PageIndex using CSS

 In this article, I have design the stylish gridview with stylish PageIndex .Many times we want to that our gridview lookwise is good.



Design:-





Source Code:-
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="gridviewpaging.aspx.cs" Inherits="gridviewpaging" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .PageIndex a
        {
            padding: 5px;
            background-color: #45A4AF;
            color: #fff;
            text-decoration: none;
            border: solid 1px #AAE;
            font-weight: bold;
            font-size: 12pt;
            font-family:@MS UI Gothic;
           
            border-style:solid;
        }
        .PageIndex span
        {
            color: #f4b541;
            font-weight: bold;
            font-size: 16pt;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="gdemp" runat="server" Width="201px" AllowPaging="True" PageSize="3"
            OnPageIndexChanging="gdemp_PageIndexChanging" CellPadding="4"
            ForeColor="#333333" GridLines="None">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="PageIndex" BackColor="#284775" ForeColor="White"
                HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>
    </div>
    </form>
</body>
</html>



 Out-Put:-

Stylish Gridview with stylish PageIndex using CSS Stylish Gridview with stylish PageIndex using CSS Reviewed by NEERAJ SRIVASTAVA on 5:38:00 PM Rating: 5

No comments:

Powered by Blogger.