如何设置列定义以正确对齐 [英] How Can I Set The Column Definition To Align Properly
本文介绍了如何设置列定义以正确对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在wpf填写grdiview
查看下面的图片
http:// postimg.org/gallery/2n8yhoubi/ab28f5ae/
但是gridview对齐不正确我怎样才能正确适合。
I am populating a grdiview in wpf
Check the image below
http://postimg.org/gallery/2n8yhoubi/ab28f5ae/
But the gridview align is not proper how can i make to fit properly.
<Grid Visibility="Visible" HorizontalAlignment="Stretch" Margin="5,5,5,0" x:Name="gdvDiagnosis" Width="Auto"
Grid.Column="1" Grid.Row="4" ScrollViewer.CanContentScroll="True"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" Height="Auto" VerticalAlignment="Stretch" Grid.RowSpan="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="0*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0"/>
<RowDefinition Height="0.43*"/>
<RowDefinition Height="8.071"/>
<RowDefinition Height="0.485*"/>
<RowDefinition Height="0.085*"/>
</Grid.RowDefinitions>
推荐答案
Hello Chandra我建议你选择Colum的宽度和高度nDefinition和RowDefinition为Auto或者Start为数字值,如1 *,2 *等。
高度为0.43 *会在对齐时产生问题。 />
我建议你坚持使用自动作为高度宽度,如果你确定你的内容宽度应该修复。
Hello Chandra I would suggest you to go with the Width and Height of your ColumnDefinition and RowDefinition as either Auto or with Start in numeric values like 1*, 2* etc.
Making height in 0.43* will create problems in your alignment.
I would suggest you to stick to Auto as height width if you are sure that your content width should be fix.
这篇关于如何设置列定义以正确对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文