vb.net gridview中数据的垂直对齐
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14770881/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
vertical align of data in a gridview
提问by Sobhan
I want my data to be displayed vertically instead of horizontal inside a gridview because there are about 65 fields and it is not coming in size for printing.
我希望我的数据在 gridview 中垂直显示而不是水平显示,因为大约有 65 个字段,并且它的大小不适合打印。
The actual view like this:
实际视图是这样的:


But I want in the form :
但我想要的形式:


Can anybody help me...
有谁能够帮助我...
回答by Adil
You can put the grid in some div and set the rotation of that div to 90 degree with css.
您可以将网格放在某个 div 中,并使用 css 将该 div 的旋转设置为 90 度。
.vertial-orientation
{
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}
<div class="vertial-orientation">
<!-- put your grid here -->
</div>
Note the support of tranform is required by the browser to apply the css.
请注意,浏览器需要支持转换才能应用 css。
回答by Lingasamy Sakthivel
You can use this property
您可以使用此属性
GridView1.RowStyle.VerticalAlign
Example:
例子:
GridView1.RowStyle.VerticalAlign=VerticalAlign.Top
Also try,
也试试,
<ItemStyle VerticalAlign="Top"></ItemStyle>

