DataGridView的:删除未使用的空间? [英] DatagridView: Remove unused space?

查看:128
本文介绍了DataGridView的:删除未使用的空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有可能除去在C#DataGridView控件的未使用空间(灰色空间)。我不得不作出在DataGridView只显示白色表。

I was wondering whether it is possible to remove the unused space ( the gray space ) of the DataGridView control in C#. I have to make the DataGridView display the white table only.

有什么建议?

推荐答案

RowsHeaderVisible 属性设置为false,你可以这样做从设计师,类别 Appearence ,或从代码:

Set the RowsHeaderVisible property to false, you can either do that from the designer, in category Appearence, or from the code :

dataGridView1.RowsHeaderVisible = false;

在为了除去在左侧的指示器排,对于灰色空间的其余部分,你可以尝试设置aforementionned AutoSizeColumnsMode 来填充,但你仍然有下部缺乏行变灰。

In order to remove the indicator row on the left side, as for the rest of the grey space, you can try set the aforementionned AutoSizeColumnsMode to Fill, but you will still have the lower part grayed out from lack of rows.

而不是调整您的细胞,以填补你的网格,你可以调整你的网格,以适应周围的细胞。不管这是一个可以接受的方法将取决于你的意图。

Instead of sizing your cells to fill your grid, you could resize your grid in order to fit around your cells. Whether or not this is an acceptable approach will depend on your intent.

我的意思是,这是可能的,如果它只是被困扰你的颜色,背景色设置为白色会做的伎俩。

I mean, it's possible that if its just the color that is bothering you, setting the backcolor to white would do the trick.

这篇关于DataGridView的:删除未使用的空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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