Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/302.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 栅格线未显示在栅格视图中_C#_Asp.net_Css - Fatal编程技术网

C# 栅格线未显示在栅格视图中

C# 栅格线未显示在栅格视图中,c#,asp.net,css,C#,Asp.net,Css,我试图在网格视图中显示数据库中的数据。我有拖放网格视图并将其绑定到SQL数据源。一切正常,但网格线没有显示。请帮我解决这个问题 这是我的密码: <%@ Page Title="" Language="C#" MasterPageFile="~/secured/secured.Master" AutoEventWireup="true" CodeBehind="GetReport.aspx.cs" Inherits="Activity.secured.WebForm1" EnableEven

我试图在网格视图中显示数据库中的数据。我有拖放网格视图并将其绑定到SQL数据源。一切正常,但网格线没有显示。请帮我解决这个问题

这是我的密码:

<%@ Page Title="" Language="C#" MasterPageFile="~/secured/secured.Master" AutoEventWireup="true" CodeBehind="GetReport.aspx.cs" Inherits="Activity.secured.WebForm1" EnableEventValidation="false"%>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
    <style type="text/css">
    #MainContent_GridView1 {
    border: solid 1px Black !important;
   }
        </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div style="overflow-x:scroll;width:1100px">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
         AutoGenerateColumns="False" DataKeyNames="ACTIVITY_ID" 
         DataSourceID="SqlDataSource1" CaptionAlign="Top" AllowSorting="True" 
         CellPadding="0" CellSpacing="1" HorizontalAlign="Center">
        <Columns>
            <asp:BoundField DataField="ACTIVITY_ID" HeaderText="ACTIVITY_ID" ReadOnly="True" SortExpression="ACTIVITY_ID" >
            </asp:BoundField>
            <asp:BoundField DataField="ACTIVITY_TYPE" HeaderText="ACTIVITY_TYPE" SortExpression="ACTIVITY_TYPE" >
            </asp:BoundField>
            <asp:BoundField DataField="TICKET_ID" HeaderText="TICKET_ID" SortExpression="TICKET_ID" >
            </asp:BoundField>
            <asp:BoundField DataField="TICKET_CATEGORY" HeaderText="TICKET_CATEGORY" SortExpression="TICKET_CATEGORY" />
            <asp:BoundField DataField="TICKET_DESCRIPTION" HeaderText="TICKET_DESCRIPTION" SortExpression="TICKET_DESCRIPTION" />
            <asp:BoundField DataField="ACTIVITY_DESCRIPTION" HeaderText="ACTIVITY_DESCRIPTION" SortExpression="ACTIVITY_DESCRIPTION" />
            <asp:BoundField DataField="MODULE" HeaderText="MODULE" SortExpression="MODULE" />
            <asp:BoundField DataField="PRIORITY" HeaderText="PRIORITY" SortExpression="PRIORITY" />
            <asp:BoundField DataField="RESOURCE_NAME" HeaderText="RESOURCE_NAME" SortExpression="RESOURCE_NAME" />
            <asp:BoundField DataField="CREATION_DATE" HeaderText="CREATION_DATE" SortExpression="CREATION_DATE" />
            <asp:BoundField DataField="ASSIGNMENT_DATE" HeaderText="ASSIGNMENT_DATE" SortExpression="ASSIGNMENT_DATE" />
            <asp:BoundField DataField="COMPLITION_DATE" HeaderText="COMPLITION_DATE" SortExpression="COMPLITION_DATE" />
            <asp:BoundField DataField="STATUS" HeaderText="STATUS" SortExpression="STATUS" />
            <asp:BoundField DataField="REMARKS" HeaderText="REMARKS" SortExpression="REMARKS" />
            <asp:BoundField DataField="EFFORTS" HeaderText="EFFORTS" SortExpression="EFFORTS" />
        </Columns>
        <EditRowStyle BackColor="White" BorderColor="Black" BorderStyle="Solid" BorderWidth="0px" />
    </asp:GridView>
        </div>
    <div>
        <asp:Button ID="btnExport1" runat="server" Text="Export to Excel" OnClick="btnExport1_Click"/>
    </div>

    </asp:SqlDataSource>
</asp:Content>

#主内容网格视图1{
边框:实心1px黑色!重要;
}

您应该按照以下方式使用

<style type="text/css">
    #MainContent_GridView1 {
        border: solid 1px Black !important;
     }
    #MainContent_GridView1 tr {
        border: solid 1px Black !important;
     }
     #MainContent_GridView1 td {
        border: solid 1px Black !important;
     }
 </style>

您应该使用以下命令

<style type="text/css">
    #MainContent_GridView1 {
        border: solid 1px Black !important;
     }
    #MainContent_GridView1 tr {
        border: solid 1px Black !important;
     }
     #MainContent_GridView1 td {
        border: solid 1px Black !important;
     }
 </style>

您可能可以使用gridLines属性:

 <asp:GridView GridLines="Both" />

您可以使用gridLines属性:

 <asp:GridView GridLines="Both" />


请从问题中删除不必要的代码。重复?:。重复?:。请从问题中删除不必要的代码。重复?:。重复?:。