.GVHeaderStyle
{
position:relative ;
table-layout:fixed;
z-index: 10;
}
<asp:Panel ID="Panel1" runat="server" Height="380px" Width="824px" ScrollBars ="Auto">
<asp:GridView ID="dgvProduce" runat="server" AllowPaging="True" ...... Width="100%">
<HeaderStyle BackColor="#6B696B" CssClass="GVHeaderStyle" Font-Bold="True"
ForeColor="White" HorizontalAlign="Center" Height="26px"/>
</asp:GridView>
</asp:Panel>
表头是固定了,但是原先的横向滚动条很长的,现在表头的字都看不清了,缩到一起了...为什么...第一次用asp.net 傻傻得求助,谢谢~!
{
position:relative ;
table-layout:fixed;
z-index: 10;
}
<asp:Panel ID="Panel1" runat="server" Height="380px" Width="824px" ScrollBars ="Auto">
<asp:GridView ID="dgvProduce" runat="server" AllowPaging="True" ...... Width="100%">
<HeaderStyle BackColor="#6B696B" CssClass="GVHeaderStyle" Font-Bold="True"
ForeColor="White" HorizontalAlign="Center" Height="26px"/>
</asp:GridView>
</asp:Panel>
表头是固定了,但是原先的横向滚动条很长的,现在表头的字都看不清了,缩到一起了...为什么...第一次用asp.net 傻傻得求助,谢谢~!
{ 控制GridView头标题属性
} */ .GridViewStyle
{/* 控制GridView整体属性 */
}
.GridViewHeaderStyle th
{ /* 控制GridView头标题属性 */
background-color:#859FD4;
border-color:White;
font-weight: bold;
color: White;
}
.GridViewRowStyle
{ /*控制带颜色的行(交替行)*/
background-color:#EFF3FB;
border: 1px solid #D2D6D7;
padding: 3px;
color: #54789B;
}
.GridViewEditRowStyle
{
}
.GridViewAlternatingRowStyle
{ /*交替行样式*/
background-color: white;
}
.GridViewRowStyle td, .GridViewAlternatingRowStyle td
{ /*控制单元格线粗细及颜色、高度等(单元格的属性)*/
border: 1px solid white;
cursor:hand;/* 鼠标移到行上时变为手型 */
} .GridViewSelectedRowStyle
{ /*选择(中)行样式*/
}
.GridViewPagerStyle, .GridViewPagerStyle td
{ /*分页样式*/
}/*GridView 的样式===============================*/
<div style="OVERFLOW: auto; WIDTH: 100%; height: 495px;"> </div>
然后将gridview的Width="xxxpx"设宽点,你说的是不是字段太多挤在一起了?