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; }
return MemberwiseClone();
}
- /*
public override ContextMenuStrip GetInheritedContextMenuStrip (int rowIndex) {
if (rowIndex != -1) {
throw new ArgumentOutOfRangeException("RowIndex is not -1");
}
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 () {
}
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) {
}
protected override bool SetValue (int rowIndex, object value) {
- throw new NotImplementedException();
+ header_text = value;
+ return true;
}
protected class DataGridViewColumnHeaderCellAccessibleObject : DataGridViewCellAccessibleObject {