2008-10-01 Jonathan Pobst <monkey@jpobst.com>
authorJonathan Pobst <monkey@jpobst.com>
Wed, 1 Oct 2008 21:48:01 +0000 (21:48 -0000)
committerJonathan Pobst <monkey@jpobst.com>
Wed, 1 Oct 2008 21:48:01 +0000 (21:48 -0000)
* DataGridViewColumnHeaderCell.cs: Correctly calculate style.
* DataGridView.cs: Use a column header's inherited style instead
of just using the default.

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

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

index 8e14c16d630c2f2685b1e3ceef81418c579885bd..b56e366b476d42c511bd554fb59b5d2eaa50d6dc 100644 (file)
@@ -1,3 +1,9 @@
+2008-10-01  Jonathan Pobst  <monkey@jpobst.com>
+
+       * DataGridViewColumnHeaderCell.cs: Correctly calculate style.
+       * DataGridView.cs: Use a column header's inherited style instead
+       of just using the default.
+
 2008-10-01  Jonathan Pobst  <monkey@jpobst.com>
 
        * SplitContainer.cs: Raise SplitterMoved when the splitter is
index f4840ba670a93a9e99f212d97f051129bca7a81b..12865d8e11994d821e79a8c6bced8f4b131f8837 100644 (file)
@@ -4302,7 +4302,7 @@ namespace System.Windows.Forms {
                                        DataGridViewAdvancedBorderStyle intermediateBorderStyle = (DataGridViewAdvancedBorderStyle)((ICloneable)this.AdvancedColumnHeadersBorderStyle).Clone ();
                                        DataGridViewAdvancedBorderStyle borderStyle = AdjustColumnHeaderBorderStyle (this.AdvancedColumnHeadersBorderStyle, intermediateBorderStyle, cell.ColumnIndex == 0, cell.ColumnIndex == columns.Count - 1);
 
-                                       cell.PaintWork (g, e.ClipRectangle, headerBounds, -1, cell.State, columnHeadersDefaultCellStyle, borderStyle, DataGridViewPaintParts.All);
+                                       cell.PaintWork (g, e.ClipRectangle, headerBounds, -1, cell.State, cell.InheritedStyle, borderStyle, DataGridViewPaintParts.All);
                                        
                                        headerBounds.X += col.Width;
                                }
index 6171526a0af8a6cca1ac34b49e0d5d754aa9c223..5678a2940156109a3a2e283baaaf57a44e7cb265 100644 (file)
@@ -60,17 +60,16 @@ namespace System.Windows.Forms {
                        return base.GetInheritedContextMenuStrip(rowIndex); //////////////////////////////
                }
 
-               public override DataGridViewCellStyle GetInheritedStyle (DataGridViewCellStyle inheritedCellStyle, int rowIndex, bool includeColors) {
-                       
-                       DataGridViewCellStyle result;
-                       
-                       if (HasStyle) {
-                               result = Style;
-                       } else {
-                               result = DataGridView.ColumnHeadersDefaultCellStyle;
-                       }
-                       
-                       return result;                  
+               public override DataGridViewCellStyle GetInheritedStyle (DataGridViewCellStyle inheritedCellStyle, int rowIndex, bool includeColors)
+               {
+                       DataGridViewCellStyle result = DataGridView.DefaultCellStyle;
+       
+                       result.ApplyStyle (DataGridView.ColumnHeadersDefaultCellStyle);
+       
+                       if (HasStyle)
+                               result.ApplyStyle (Style);
+
+                       return result;
                }
 
                public override string ToString () {