在C#中取出数据网格空灰空间 [英] removing the empty gray space in datagrid in c#

查看:80
本文介绍了在C#中取出数据网格空灰空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何删除空的空间,即我想要的数据网格自动调整自身大小取决于没有。行。我知道列,我们可以通过填写AutoSizeColumnMode值做到这一点,但对于AutoSizeRowsMo​​de没有填充值。

how do i remove the empty space i.e. i want the datagrid to automatically resize itself depending upon the no. of rows. i know for columns we can do that by using fill value in AutoSizeColumnMode, but there is no fill value for AutoSizeRowsMode.

推荐答案

一个黑客一点,但你可以尝试这样的:

A bit of a hack but you may try this:

dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control;

顺便说一下这一直是<一个href=\"http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=116071\">reported作为一个bug 。

这篇关于在C#中取出数据网格空灰空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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