调整的DataGridView的列以填充可用空间如果网格比可用的空间更小,使用滚动的情况下的网格更大 [英] Adjust DataGridView's columns to fill available space if the grid is smaller and use scroll in case the grid bigger than the space available

查看:264
本文介绍了调整的DataGridView的列以填充可用空间如果网格比可用的空间更小,使用滚动的情况下的网格更大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据所需空间完全显示其所有数据,以调整一个DataGridView的所有列。如果所需的空间大于可用空间我想网格来填补这个超过空间变小,但如果是可用的空间不够正确显示我想的DataGridView自动创建一个滚动的所有列。有没有一种简单的方法来做到这一点?

I want to adjust all columns of a DataGridView according to the required space to show all its data completely. If the space required is smaller than the available space i want the grid to fill this exceeding space, but if the available is space is not enough to display properly all columns i want to DataGridView create automatically a scroll. Is there an easy way to do this?

推荐答案

点击过的DataGridView并选择编辑列...,然后去布局,并设置AutoSizeMode来填充。

Click over the DataGridView and select "Edit Columns...", then go to "Layout" and set "AutoSizeMode" to "Fill".

希望这是你在寻找什么。

Hope this is what you're looking for.

干杯

这篇关于调整的DataGridView的列以填充可用空间如果网格比可用的空间更小,使用滚动的情况下的网格更大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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