我如何给我的GridView中的每个列的固定大小 [英] How can i give fixed size for each columns in my gridview

查看:149
本文介绍了我如何给我的GridView中的每个列的固定大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网格视图,每列有不同长度的数据。
i希望根据数据自定义每列。



我已添加属性ControlStyle-Width =400



但我在执行调试运行时没有看到任何变化。

列元素上的ItemStyle-Width属性 ... />
< asp:BoundField ItemStyle-Width =123... />
//等等


I have a Grid view and each column have different length of data. i want to customize each columns according to data.

i have added property ControlStyle-Width="400"

but i didnt see any change when i do a debug run.

解决方案

Try the ItemStyle-Width attribute on the column elements

<asp:TemplateField ItemStyle-Width="123" ... />
<asp:BoundField ItemStyle-Width="123" ... />
// etc.

这篇关于我如何给我的GridView中的每个列的固定大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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