X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FManaged.Windows.Forms%2FSystem.Windows.Forms%2FDataGridViewColumnHeaderCell.cs;h=ae301720df93173932b02d0a1bd437b7cd156f1e;hb=0593cad751880a0490cd388933ab8ded6b3c0334;hp=48286259c2147ff3d048fdc83010a8253ccf4483;hpb=b5cfba1835f2ba823796f825410e0062b7e4c9a3;p=mono.git diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumnHeaderCell.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumnHeaderCell.cs index 48286259c21..ae301720df9 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumnHeaderCell.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumnHeaderCell.cs @@ -28,16 +28,19 @@ using System; using System.Drawing; +using System.ComponentModel; namespace System.Windows.Forms { public class DataGridViewColumnHeaderCell : DataGridViewHeaderCell { private SortOrder sortGlyphDirection = SortOrder.None; - + private object header_text; + public DataGridViewColumnHeaderCell () { } + [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] public SortOrder SortGlyphDirection { get { return sortGlyphDirection; } set { sortGlyphDirection = value; } @@ -47,7 +50,6 @@ namespace System.Windows.Forms { return MemberwiseClone(); } - /* public override ContextMenuStrip GetInheritedContextMenuStrip (int rowIndex) { if (rowIndex != -1) { throw new ArgumentOutOfRangeException("RowIndex is not -1"); @@ -57,10 +59,18 @@ namespace System.Windows.Forms { } return base.GetInheritedContextMenuStrip(rowIndex); ////////////////////////////// } - */ public override DataGridViewCellStyle GetInheritedStyle (DataGridViewCellStyle inheritedCellStyle, int rowIndex, bool includeColors) { - throw new NotImplementedException(); + + DataGridViewCellStyle result; + + if (HasStyle) { + result = Style; + } else { + result = DataGridView.ColumnHeadersDefaultCellStyle; + } + + return result; } public override string ToString () { @@ -85,7 +95,13 @@ namespace System.Windows.Forms { } protected override object GetValue (int rowIndex) { - throw new NotImplementedException(); + if (header_text != null) + return header_text; + + if (OwningColumn != null) + return OwningColumn.Name; + + return null; } protected override void Paint (Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates dataGridViewElementState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) { @@ -95,7 +111,8 @@ namespace System.Windows.Forms { } protected override bool SetValue (int rowIndex, object value) { - throw new NotImplementedException(); + header_text = value; + return true; } protected class DataGridViewColumnHeaderCellAccessibleObject : DataGridViewCellAccessibleObject {