WPF grdiview宽度对齐 [英] WPF grdiview width alignment

查看:79
本文介绍了WPF grdiview宽度对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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>

推荐答案

您没有明确定义宽度,因此它占用的空间与它所需的空间一样多。您可以在ColumnDefinition中明确定义列宽。
You have not explicitly defined width, so it is taking as much as space it requires. You can explicitly define column width in ColumnDefinition.


这篇关于WPF grdiview宽度对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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