如何使XAML DataGridColumns填满整个DataGrid的? [英] How do I make XAML DataGridColumns fill the entire DataGrid?

查看:329
本文介绍了如何使XAML DataGridColumns填满整个DataGrid的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用XAML(不Silverlight的)与可调整大小的列DataGrid中,则DataGrid会如果用户调整画面展开。

I am using DataGrids in XAML (not Silverlight) with resizable columns, the DataGrid will expand if the user resizes the screen.

目前,如果所有的DataGrid列的宽度小于DataGrid中,我得到一个额外的列的宽度出现是不可点击,并没有任何用处。

Currently if the widths of all the DataGrid columns are less than the width of the DataGrid I get an extra "column" appearing which is unclickable and serves no purpose.

有谁知道如何使一列始终调整,以填补所有的剩余空间?

Does anyone know how to make one column always resize to fill all the remaining space?

推荐答案

如果您使用 WIDTH =*列将填补扩大可用空间。

If you use Width="*" the column will fill to expand the available space.

如果您希望所有列划分网格这同样适用于所有列。如果你只是想要一个来填补剩余空间只是它与其余为自动或某个特定的宽度适用于该列。

If you want all columns to divide the grid equally apply this to all columns. If you just want one to fill the remaining space just apply it to that column with the rest being "Auto" or a specific width.

您也可以使用 WIDTH =0.25 *(例如)如果你想列占用的可用宽度的1/4。

You can also use Width="0.25*" (for example) if you want the column to take up 1/4 of the available width.

这篇关于如何使XAML DataGridColumns填满整个DataGrid的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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