简体   繁体   English

手动调整gridview列的大小

[英]resizing gridview column manually

I have a gridview that I am displaying email html in. The columns are very wide because of the way the html is formated. 我有一个gridview,我正在其中显示电子邮件html。由于html的格式化方式,所以列很宽。 How can I manually set the size of the column in the gridview? 如何在gridview中手动设置列的大小? I tried 我试过了

Item-Style width = 项目样式宽度=

Header-Style width = 标题样式的宽度=

but none of those change the column width, any ideas would be appreciated. 但是这些都没有改变列宽,任何想法都将不胜感激。

Thank you, 谢谢,

 <asp:BoundField HeaderText="Message"  HeaderStyle-Width="100px" ItemStyle-Width="100px" ItemStyle-Wrap="false" HeaderStyle-Wrap="false" HtmlEncode="false" DataField="message" />

follow this pattern , and you will succeed , good luck ;) 遵循这种模式,您会成功的,祝您好运;)

<asp:BoundField DataField="ISBN" HeaderText="ISBN" ItemStyle-Width="120px" HeaderStyle-Height="40px">
     <HeaderStyle Height="40px"></HeaderStyle>
     <ItemStyle Width="120px"></ItemStyle>
</asp:BoundField>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM