如何使一个DataGridView不对齐的行控制的顶部? [英] How do I make a DataGridView that doesn't snap its rows to the top of the control?

查看:80
本文介绍了如何使一个DataGridView不对齐的行控制的顶部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经在我们的客户中使用DataGridView的广泛应用。我们的客户希望能够进入大量文本成一排 - 通过他们,并滚动使用主滚动条 - - 太多要显示在DataGridView的高度。即在DataGridView的滚动条

We've used the DataGridView extensively in our client. Our customers want to be able to enter large amounts of text into a row - too much to be displayed in the height of the DataGridView - and scroll through them using the main scrollbar - i.e. the DataGridView's scrollbar.

不过,在DataGridView只滚动,使得行捕捉到控件的顶部;如果行比DataGridView的大,那么你永远只能看到它的顶部。

However, the DataGridView will only scroll such that a row is snapped to the top of the control; if a row is larger than the DataGridView then you can only ever see the top of it.

我如何做一个DataGridView不对齐的行控制的顶部?

How do I make a DataGridView that doesn't snap its rows to the top of the control?

推荐答案

放在一个Panel控件中的DataGridView,使面板滚动。确保在DataGridView的Dock设置为none和高度设置为网格行的高度之和。

Put the DataGridView in a Panel control and make the Panel scrollable. Make sure the DataGridView's Dock is set to none and the Height is set to the sum of the heights of the rows in the grid.

这篇关于如何使一个DataGridView不对齐的行控制的顶部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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