removing the empty gray space in datagrid in c#

c#

Solution

A bit of a hack but you may try this:

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

Btw this has been reported as a bug.

Problem

alt text http://www.freeimagehosting.net/uploads/260c1f6706.jpg 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.

Original source