2008-05-21 Jonathan Pobst <monkey@jpobst.com>
authorJonathan Pobst <monkey@jpobst.com>
Wed, 21 May 2008 16:33:44 +0000 (16:33 -0000)
committerJonathan Pobst <monkey@jpobst.com>
Wed, 21 May 2008 16:33:44 +0000 (16:33 -0000)
* DataGridView.cs: Only paint the top left header cell if there
are columns.

svn path=/trunk/mcs/; revision=103716

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs

index 7ae3b1500778e0004efeb94819d08e6a6626e7d0..89c870ac970973ef7491d1f19adbf4b16643e13f 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-21  Jonathan Pobst  <monkey@jpobst.com>
+
+       * DataGridView.cs: Only paint the top left header cell if there
+       are columns.
+
 2008-05-21  Jonathan Pobst  <monkey@jpobst.com>
 
        * DataGridView.cs: When binding to a BindingSource, get the underlying
index ff760bc132a2ae8b73dec44064fbff199c6810b9..256a1e947b88109c610678e143ad802f64241e42 100644 (file)
@@ -4200,7 +4200,7 @@ namespace System.Windows.Forms {
                        bounds.Inflate (-BorderWidth, -BorderWidth);
                        
                        // Paint the top left cell
-                       if (rowHeadersVisible && columnHeadersVisible) {
+                       if (rowHeadersVisible && columnHeadersVisible && ColumnCount > 0) {
                                Rectangle topleftbounds = new Rectangle (bounds.X, bounds.Y, rowHeadersWidth, columnHeadersHeight);
                                
                                TopLeftHeaderCell.PaintWork (g, e.ClipRectangle, topleftbounds, -1, TopLeftHeaderCell.State, ColumnHeadersDefaultCellStyle, AdvancedColumnHeadersBorderStyle, DataGridViewPaintParts.All);