在ASP.NET 2.0中的Gridview列宽 [英] Gridview Column Width in ASP.NET 2.0

查看:91
本文介绍了在ASP.NET 2.0中的Gridview列宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何控制ASP.NET 2.0中gridview控件的列宽?

您可以使用HeaderStyle -Width,ItemStyle-Width或FooterStyle-Width属性。这些可以适用于所有列或每列的基础。

 < asp:GridView ID =GridView1runat = 服务器 > 
< HeaderStyle Width =10%/>
< RowStyle Width =10%/>
< FooterStyle Width =10%/>
<列>
HeaderStyle-Width =10%ItemStyle-Width =10%
FooterStyle-Width =10% />
< /列>
< / asp:GridView>


How do you control the column width in a gridview control in ASP.NET 2.0?

解决方案

You can use the HeaderStyle-Width, ItemStyle-Width or FooterStyle-Width properties. These can be applied to all the columns or per-column basis.

    <asp:GridView ID="GridView1" runat="server">
        <HeaderStyle Width="10%" />
        <RowStyle Width="10%" />
        <FooterStyle Width="10%" />
        <Columns>
            <asp:BoundField HeaderText="Name" DataField="LastName" 
                HeaderStyle-Width="10%" ItemStyle-Width="10%"
                FooterStyle-Width="10%" />
        </Columns>
    </asp:GridView>

这篇关于在ASP.NET 2.0中的Gridview列宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆