相当复杂,但我在GridView上面的Div内部尝试了旧的overflow-x:auto
并且它没有用。有没有其他解决方案?我会尝试将代码保存到相关内容中,因此我的ASP看起来像这样 :
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="MainDiv" style="height:500px; margin-left:20px;">
<asp:Panel runat="server" ID="ShowDiv1" Visible="false" BorderStyle="Solid" BorderWidth="0" Width="440px" Height="530px" style="margin-left:20px;">
<asp:DropDownList ID="ddlStatusCode" runat="server" OnSelectedIndexChanged="ddlStatusCode_OnSelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Value="1"> Open </asp:ListItem>
<asp:ListItem Value="2"> Pended for Source Documents </asp:ListItem>
<asp:ListItem Value="3"> Send to CSE </asp:ListItem>
<asp:ListItem Value="4"> Send to Auditor </asp:ListItem>
<asp:ListItem Value="5"> Assigned </asp:ListItem>
<asp:ListItem Value="6"> Question to TC </asp:ListItem>
</asp:DropDownList>
<!-- Leads: 1 -->
<div id="divGrid_Open" runat="server" style='width:1350px; height:320px; overflow-x:auto'>
<asp:GridView ID="DataGrid_Open" runat="server"
AllowSorting="True" AutoGenerateColumns="False" ShowFooter ="false" CellPadding="0"
CssClass="hoverTable"
HeaderStyle-BackColor="#5D7B9D" HeaderStyle-BorderColor="#4DA6A6" HeaderStyle-ForeColor="White"
HeaderStyle-Font-Size="x-Small" itemstyle-font-size="x-small" EditItemStyle-font-size="x-small"
FooterStyle-BackColor="#5D7B9D" FooterStyle-BorderColor="#4DA6A6" FooterStyle-ForeColor="White"
DataKeyNames="Audit_Number"
OnRowCancelingEdit="DataGrid_Open_CancelCommand"
OnRowDataBound="DataGrid_Open_RowDataBound"
OnDataBound="DataGrid_Open_OnDataBound"
OnRowEditing="DataGrid_Open_EditCommand"
OnRowUpdating="DataGrid_Open_UpdateCommand">
<Columns>
<asp:TemplateField HeaderText="Audit <br />Number" >
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:Label ID="I_Open_AuditNbr" runat="server" Width="60px" Text='<%#Eval("Audit_Number") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:Label ID="EI_Open_AuditNbr" runat="server" Width="60px" Text='<%#Eval("Audit_Number") %>'></asp:Label>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="F_Open_AuditNbr" runat="server" Width="60px" ></asp:TextBox>
</FooterTemplate>
</asp:TemplateField>
ETC....
</Columns>
</asp:GridView>
<asp:Label ID="lblEmpty1" runat="server" Visible="false" Style="font-weight:bold; font-size:large;"></asp:Label>
</div>
</asp:Panel>
</div>
</asp:Content>