怎样编写GridView皮肤??

解决方案 »

  1.   

    Skin1.skin
    <asp:GridView runat="server" BackColor="Green" >
      <AlternatingRowStyle BackColor="Blue" />
    </asp:GridView>
    theme="Skin1"
      

  2.   

    下面是textbox的实例:1.添加皮肤文件SkinFile.skin 
    文件代码举例 <asp:Button runat="server"  CssClass="mybutton_style"  /> 
    mybutton_style就是你的按钮样式,可以再css文件中写,css文件直接放到与SkinFile.skin 
    同一文件夹下就可以了 
    CSS codecss文件中代码:
    .mybutton_style{
    BORDER-RIGHT: #7b9ebd 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7b9ebd 1px solid;
    PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: 
    progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#cecfde); BORDER-LEFT: #7b9ebd 1px solid; CURSOR: hand; COLOR: black;
     PADDING-TOP: 2px; BORDER-BOTTOM: #7b9ebd 1px solid
    }然后在页面中的textbox中设置theme="SkinFile"就可以了。
      

  3.   

    学Css够用吗?你那是html美工吧。asp.net的skin中包括Css和asp.net样式,Css只占一小点部分。不要拿一个html美工冒充asp.net美工,去学好asp.net的theme技术吧!
      

  4.   

    <asp:GridView runat="server" BackColor="#ffffff" CellPadding="3" GridLines="None" CellSpacing="1" Width="100%" >
       <AlternatingRowStyle BackColor="#ECECEC" />
       <HeaderStyle BackColor="#9097A9" ForeColor="#FFFFFF" />
       <FooterStyle BackColor="#E5F3F6" />
       <PagerStyle BackColor="#E5F3F6" />
       <RowStyle BackColor="#D8D8D8" HorizontalAlign="center" />
       <SelectedRowStyle />
    </asp:GridView> 
      

  5.   

    引用 4 楼 sp1234 的回复:
    学Css够用吗?你那是html美工吧。 asp.net的skin中包括Css和asp.net样式,Css只占一小点部分。 不要拿一个html美工冒充asp.net美工,去学好asp.net的theme技术
      

  6.   

    CSS部门:
    .GridFrame
    {}{
        margin-top: 5px;
        border-collapse: collapse;
        border-right: #7c9ccf 1px solid;
        border-top: #7c9ccf 1px solid;
        border-left: #7c9ccf 1px solid;
        border-bottom: #7c9ccf 1px solid;
    }
    .GridItem td ,.GridAlter td
    {}{
        border-right: #999999 1px solid;
        border-top: #999999 1px solid;
        border-left: #999999 1px solid;
        border-bottom: #999999 1px solid;
    }
    .GridItem
    {}{
        font-family: arial;
        font-size: 9pt;
        background: #f1f1f1;
        padding: 0px 4px 0px 4px;
        height: 14px;
    }.GridEdit
    {}{
        font-family: arial;
        font-size: 9pt;
        background: #ffffff;
        padding: 0px 4px 0px 4px;
        height: 14px;
    }.GridHeader
    {}{
        font: bold ;
        font-family: 宋体;
        font-size: 9pt;
        background: #8caae7;
        border-bottom: #7c9ccf 1px solid;
        border-top: #7c9ccf 1px solid;
        color: #ffffff;
        text-align:center;
        height:18px;
    }
    .GridHeader th
    {}{
        font: bold ;
        font-family: 宋体;
        font-size: 9pt;
        background: #8caae7;
        border-bottom: #7c9ccf 1px solid;
        border-top: #7c9ccf 1px solid;
        color: #ffffff;
        text-align:center;
    }.GridAlter
    {}{
        font-family: arial;
        font-size: 9pt;
        background: #f1f1f1;
        padding: 0px 4px 0px 4px;
        height: 14px;
    }【gridview】<asp:GridView runat="server" SkinId="Default" CssClass="GridFrame"  CellPadding="0" CellSpacing="0" AutoGenerateColumns="False"><RowStyle CssClass="GridItem" /><EditRowStyle CssClass="GridEdit" /><SelectedRowStyle CssClass="GridHeader" /><PagerStyle CssClass="GridItem" /><HeaderStyle CssClass="GridHeader" /><FooterStyle CssClass="GridFooter" /><AlternatingRowStyle CssClass="GridAlter" /></asp:GridView>