开发者

ASP.net remove column borders from Gridview footer in CSS. just wont go away!

开发者 https://www.devze.com 2023-01-28 08:51 出处:网络
OK, so this is bugging me. I have a gridview in ASP.net which I\'ve enabled the footer on: <asp:GridView ID=\"Results_GridView\" runat=\"server\" AutoGenerateColumns=\"False\" CssClass=\"mGrid\" P

OK, so this is bugging me. I have a gridview in ASP.net which I've enabled the footer on:

    <asp:GridView ID="Results_GridView" runat="server" AutoGenerateColumns="False" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" ShowFooter="True" GridLines="None">

Then I've set the footer CSS style:

<FooterStyle CssClass="footer" />

That all appears fine, the images are displayed etc, although I cant get rid of the borders from the columns above!

.mGrid { width: 100%; background-color: #fff; margin: 5px 0 10px 0; border: solid 1px #525252; border-collapse:collapse; }
.mGrid td { padding: 2px; border: solid 1px #c1c1c1; color: #717171; }
.mGrid th { padding: 4px 2px; color: #fff; background: #424242 url(grd_head.png) repeat-x top; border-left: solid 1px #525252; font-size: 0.9em; }
.mGrid .alt { background: #fcfcfc url(grd_alt.png) repeat-x top;}
.mGrid .footer {
height: 15px; width: 100%; background: #BCC51A url(grd_footer.png) repeat-x top; border-   spacing: 0; border-width: 0; border: none; border-left:none; border-right:none; border-style:none;
}

And they just wont go away :( I've tried changing the borders in visual studio too, no luck.

Heres my whole ASPX file for reference

<%@ Page La开发者_如何学运维nguage="VB" AutoEventWireup="false" CodeFile="DiscTypeSelector.aspx.vb"     Inherits="DiskSelector" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ import Namespace="System.Data" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Disc Burst Selector</title>
<link type="text/css" rel="stylesheet" href="css/style.css" />
</head>
<body>

<form id="form1" runat="server">
<div>
    <asp:Panel ID="Panel1" runat="server" Width="400px" BorderStyle="Solid" BorderWidth="1px" HorizontalAlign="Justify">
        <asp:Label ID="Label1" runat="server" Text="Burst Pressure " Width="122px"> </asp:Label>
        <asp:TextBox ID="pressure_input" runat="server" Width="150px">0</asp:TextBox><br />
        <br />
        <asp:Label ID="lbltemp" runat="server" Text="Temperature" Width="122px">    </asp:Label>
        <asp:TextBox ID="temp_input" runat="server" Width="150px">0</asp:TextBox><br />
        <br />
        <asp:Label ID="lblBore" runat="server" Text="Nominal Bore (mm)" Width="122px">  </asp:Label>
        <asp:DropDownList ID="dropBore" runat="server" Width="69px"   AutoPostBack="False">
            <asp:ListItem>15</asp:ListItem>
            <asp:ListItem>25</asp:ListItem>
            <asp:ListItem>40</asp:ListItem>
            <asp:ListItem>50</asp:ListItem>
            <asp:ListItem>65</asp:ListItem>
            <asp:ListItem>80</asp:ListItem>
            <asp:ListItem>100</asp:ListItem>
            <asp:ListItem>150</asp:ListItem>
            <asp:ListItem>200</asp:ListItem>
            <asp:ListItem>250</asp:ListItem>
            <asp:ListItem>300</asp:ListItem>
            <asp:ListItem>350</asp:ListItem>
            <asp:ListItem>400</asp:ListItem>
            <asp:ListItem>450</asp:ListItem>
            <asp:ListItem>500</asp:ListItem>
            <asp:ListItem>600</asp:ListItem>
            <asp:ListItem>700</asp:ListItem>
            <asp:ListItem>800</asp:ListItem>
        </asp:DropDownList><br />
        <br />
        <asp:Label ID="lblFrag" runat="server" Text="Fragmentation Issue"></asp:Label>
        <asp:RadioButtonList ID="radioFrag" runat="server" RepeatDirection="Horizontal"
            RepeatLayout="Flow" Width="94px">
            <asp:ListItem Selected="True">Yes</asp:ListItem>
            <asp:ListItem>No</asp:ListItem>
        </asp:RadioButtonList><br />
        <br />
        <asp:Label ID="lblMounting" runat="server" Text="Mounting" Width="111px"> </asp:Label>
        <asp:DropDownList ID="dropMounting" runat="server" Width="130px">
            <asp:ListItem>PN6</asp:ListItem>
            <asp:ListItem>PN10</asp:ListItem>
            <asp:ListItem>PN16</asp:ListItem>
            <asp:ListItem>PN20</asp:ListItem>
            <asp:ListItem>PN25</asp:ListItem>
            <asp:ListItem>PN40</asp:ListItem>
            <asp:ListItem>ANSI 150</asp:ListItem>
            <asp:ListItem>ANSI 300</asp:ListItem>
            <asp:ListItem>ANSI 600</asp:ListItem>
            <asp:ListItem>Other</asp:ListItem>
        </asp:DropDownList><br />
        <br />
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
        <asp:Button ID="btnSubmit" runat="server" Height="40px" Text="Update results" Width="140px" UseSubmitBehavior="False" CssClass="updateButtonStyle"  /><br />
        <br />
        <br />
    </asp:Panel>
    <br />
    <br />

      <asp:GridView ID="Results_GridView" runat="server" AutoGenerateColumns="False"  CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt"  ShowFooter="True" GridLines="None">
        <Columns>
            <asp:BoundField DataField="Disc_Type_Name" HeaderText="Disc Type"  SortExpression="Disc_Type_Name" />
            <asp:BoundField DataField="Disc_Material_Name" HeaderText="Disc Material"  SortExpression="Disc_Material_Name" />
            <asp:BoundField DataField="Disc_Forward_Acting" HeaderText="Forward/Reverse" SortExpression="Disc_Forward_Acting" />
            <asp:BoundField DataField="Disc_Vacuum" HeaderText="Vacuum Service" SortExpression="Disc_Vacuum" />
            <asp:BoundField DataField="Disc_Lgv" HeaderText="Liquid, Gas and Vapour Compatability"
                SortExpression="Disc_Lgv" />
            <asp:TemplateField HeaderText="MAX Working Pressure">
            <ItemTemplate> 
  <asp:Label ID="lblMaxPressure" Runat="Server"  />
</ItemTemplate>

            </asp:TemplateField>
            <asp:TemplateField HeaderText="Flange Rating"></asp:TemplateField>
        </Columns>
        <AlternatingRowStyle CssClass="alt" />
          <FooterStyle CssClass="footer" />
          <PagerStyle CssClass="pgr" />
    </asp:GridView>


</div>
</form>

And theres the little buggers that wont go away!

http://i.stack.imgur.com/2yN41.png


Any help extremely appreciated!!! (been through pages and pages of similar threads)

Cheers tutts :)


solved it. the footer uses the same td th, which need to be defined in the CSS as follows.

.footer { height: 15px; width: 100%; background: #BCC51A url(grd_footer.png) repeat-x top; } 
.footer td{border: none} 
.footer th{border: none} 


Rather than sifting through your code, I am gonna suggest that you use Firebug or the IE Developer Tools to find out what CSS style is causing the line. This is usually the quickest way to success.

0

精彩评论

暂无评论...
验证码 换一张
取 消