gridview标头高度 [英] gridview header height
问题描述
先生您好,
我写了一个div标签,在divtag中有一个面板.
该面板包含一个gridview.
div标签的宽度是1050,我将面板的宽度设置为100%.
我需要将gridview设置为1500(带有滚动条).
有可能吗?
我将面板宽度设为200%,gridview为1500,但标题行受到了影响.
如何以适当的方式做到这一点?
如果有人知道,请告诉我.
谢谢你,先生.
Hello sir,
I write a div tag and within the divtag I have a panel.
The panel contains a gridview.
The div tag width is 1050 and I made the panel width 100%.
I need the gridview to be 1500 (with scroll bar).
Is it possible?
I took panel width to 200% and gridview is 1500, but header row is affected.
How can I do this in a proper way?
If anybody knows, please tell me.
thanking you sir.
<tr>
<td colspan="6" style="width:1055;" align="left">
<table class="tableStyleBorder " style="width:1055px;">
<tr >
<td colspan="6" style="width:1050;">
<div id="DivGrid" runat="server" style=" overflow: scroll; width:1050px; height: 200px;">
<asp:Panel ID="PanelGrid" runat="server" Width="200%" Height="200">
<asp:GridView ID="GVProductOrder" runat="server" CssClass="grid" AutoGenerateColumns="false" GridLines="Vertical" Height="200" Width="1050" PageSize="10">
<HeaderStyle CssClass="HeaderStyleGrid" />
<AlternatingRowStyle BackColor ="#F8F8F8" Height="10"/>
<RowStyle Height="10"/>
<Columns>
<asp:BoundField DataField="ItemCode" HeaderText="Item Code" HeaderStyle-Width="80" HeaderStyle-Height="20" ItemStyle-Wrap ="true" />
<asp:BoundField DataField="ItemName" HeaderText="Item Name" HeaderStyle-Width="200px" HeaderStyle-Height="20" ItemStyle-Wrap ="true" />
<asp:BoundField DataField="EanCode" HeaderText="Ean Code" HeaderStyle-Width="100px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true" />
<asp:BoundField DataField="Cost" HeaderText="Cost" HeaderStyle-Width="80px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
<asp:BoundField DataField="MRP" HeaderText="MRP" HeaderStyle-Width="80px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
<asp:BoundField DataField="SP" HeaderText="SP" HeaderStyle-Width="80px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
<asp:BoundField DataField="MBQ" HeaderText="MBQ" HeaderStyle-Width="100px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
<asp:BoundField DataField="Quantity" HeaderText="Quantity" HeaderStyle-Width="50px" HeaderStyle-Height="20px"/>
<asp:BoundField DataField="FreeQty" HeaderText="Free Qty" HeaderStyle-Width="50px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
<asp:BoundField DataField="FixedDisc" HeaderText="Fixed Disc" HeaderStyle-Width="50px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
<asp:BoundField DataField="Tax" HeaderText="Tax" HeaderStyle-Width="50px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
<asp:BoundField DataField="Value" HeaderText="Value" HeaderStyle-Width="100px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
<asp:BoundField DataField="OnOrder" HeaderText="On Order" HeaderStyle-Width="100px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
<asp:BoundField DataField="Remarks" HeaderText="Remarks" HeaderStyle-Width="300px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
<asp:BoundField DataField="Type" HeaderText="Type" HeaderStyle-Width="100px" HeaderStyle-Height="20px" ItemStyle-Wrap ="true"/>
推荐答案
我认为您应该在Gridview的CSS中查找以下内容
I think you should look in to the CSS for the Gridview for below one
<headerstyle cssclass="HeaderStyleGrid" />
绑定列的高度会有所不同
It would be differ with the bound columns height
<asp:boundfield datafield="ItemCode" headertext="Item Code" headerstyle-width="80" headerstyle-height="20" itemstyle-wrap="true" xmlns:asp="#unknown" />
对于绑定列,您已将高度设置为20,但是可能为css类 HeaderStyleGrid 设置了一个不同的值,因此请进行检查.另外,您的问题有点令人困惑,因此我根据我的猜测在此给出了答案.
For bound column you have set 20 for height, but you might been set a different vale for the css class HeaderStyleGrid, so check it. Also your question is confusing little bit so I gave this here based on my guess.
这篇关于gridview标头高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!