2 // System.Windows.Forms.DataGridTableStyle
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
6 // Dennis Hayes (dennish@Raytek.com)
8 // (C) Ximian, Inc., 2002
11 using System
.ComponentModel
;
13 using System
.Collections
;
15 namespace System
.Windows
.Forms
{
18 /// Represents the table drawn by the System.Windows.Forms.DataGrid control at run time.
22 public class DataGridTableStyle
: Component
{
25 // This member supports the .NET Framework infrastructure and is not intended to be used directly from your code:
26 // public static DataGridTableStyle DefaultTableStyle;
28 Color alternatingBackColor
;
30 bool columnHeadersVisible
;
34 DataGridLineStyle gridLineStyle
;
35 Color headerBackColor
;
37 Color headerForeColor
;
40 int preferredColumnWidth
;
41 int preferredRowHeight
;
43 bool rowHeadersVisible
;
45 Color selectionBackColor
;
46 Color selectionForeColor
;
51 public DataGridTableStyle()
54 alternatingBackColor
=SystemColors
.Window
;
55 gridLineStyle
=DataGridLineStyle
.Solid
;
56 rowHeadersVisible
=true;
59 // This member supports the .NET Framework infrastructure and is not intended to be used directly from your code:
60 // public DataGridTableStyle(bool isDefaultTableStyle);
63 public DataGridTableStyle(CurrencyManager listManager
) : this()
70 public bool AllowSorting
{
71 get { return allowSorting; }
72 set { allowSorting=value; }
75 public Color AlternatingBackColor
{
76 get { return alternatingBackColor; }
77 set { alternatingBackColor=value; }
80 public Color BackColor
{
81 get { return backColor; }
82 set { backColor=value; }
85 public bool ColumnHeadersVisible
{
86 get { return columnHeadersVisible; }
87 set { columnHeadersVisible=value; }
90 public virtual DataGrid DataGrid
{
91 get { return dataGrid; }
92 set { dataGrid=value; }
95 public Color ForeColor
{
96 get { return foreColor; }
97 set { foreColor=value; }
101 public virtual GridColumnStylesCollection GridColumnStyles
{
102 get { throw new NotImplementedException (); }
105 public Color GridLineColor
{
106 get { return gridLineColor; }
107 set { gridLineColor=value; }
110 public DataGridLineStyle GridLineStyle
{
111 get { return gridLineStyle; }
112 set { gridLineStyle=value; }
115 public Color HeaderBackColor
{
116 get { return headerBackColor; }
117 set { headerBackColor=value; }
120 public Font HeaderFont
{
121 get { return headerFont; }
122 set { headerFont=value; }
125 public Color HeaderForeColor
{
126 get { return headerForeColor; }
127 set { headerForeColor=value; }
130 public Color LinkColor
{
131 get { return linkColor; }
132 set { linkColor=value; }
135 // This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
136 // public Color LinkHoverColor {get; set;}
138 public string MappingName
{
139 get { return mappingName; }
140 set { mappingName=value; }
143 public int PreferredColumnWidth
{
144 get { return preferredColumnWidth; }
145 set { preferredColumnWidth=value; }
148 public int PreferredRowHeight
{
149 get { return preferredRowHeight; }
150 set { preferredRowHeight=value; }
153 public virtual bool ReadOnly
{
154 get { return allowSorting; }
155 set { allowSorting=value; }
158 public bool RowHeadersVisible
{
159 get { return rowHeadersVisible; }
160 set { rowHeadersVisible=value; }
164 public int RowHeaderWidth
{
165 get { return rowHeaderWidth; }
166 set { rowHeaderWidth=value; }
169 public Color SelectionBackColor
{
170 get { return selectionBackColor; }
171 set { selectionBackColor=value; }
174 public Color SelectionForeColor
{
175 get { return selectionForeColor; }
176 set { selectionForeColor=value; }
182 public bool BeginEdit(DataGridColumnStyle gridColumn
,int rowNumber
)
184 throw new NotImplementedException ();
188 protected internal virtual DataGridColumnStyle
CreateGridColumn(PropertyDescriptor prop
)
190 throw new NotImplementedException ();
194 protected internal virtual DataGridColumnStyle
CreateGridColumn(PropertyDescriptor prop
,bool isDefault
)
196 throw new NotImplementedException ();
200 protected override void Dispose(bool disposing
)
203 base.Dispose(disposing
);;
207 public bool EndEdit(DataGridColumnStyle gridColumn
,int rowNumber
,bool shouldAbort
)
209 throw new NotImplementedException ();
213 protected virtual void OnAllowSortingChanged(EventArgs e
)
219 protected virtual void OnAlternatingBackColorChanged(EventArgs e
)
225 protected virtual void OnBackColorChanged(EventArgs e
)
231 protected virtual void OnColumnHeadersVisibleChanged(EventArgs e
)
237 protected virtual void OnForeColorChanged(EventArgs e
)
243 protected virtual void OnGridLineColorChanged(EventArgs e
)
249 protected virtual void OnGridLineStyleChanged(EventArgs e
)
255 protected virtual void OnHeaderBackColorChanged(EventArgs e
)
261 protected virtual void OnHeaderFontChanged(EventArgs e
)
267 protected virtual void OnHeaderForeColorChanged(EventArgs e
)
273 protected virtual void OnLinkColorChanged(EventArgs e
)
279 protected virtual void OnLinkHoverColorChanged(EventArgs e
)
285 protected virtual void OnMappingNameChanged(EventArgs e
)
291 protected virtual void OnPreferredColumnWidthChanged(EventArgs e
)
297 protected virtual void OnPreferredRowHeightChanged(EventArgs e
)
303 protected virtual void OnReadOnlyChanged(EventArgs e
)
309 protected virtual void OnRowHeadersVisibleChanged(EventArgs e
)
315 protected virtual void OnRowHeaderWidthChanged(EventArgs e
)
321 protected virtual void OnSelectionBackColorChanged(EventArgs e
)
327 protected virtual void OnSelectionForeColorChanged(EventArgs e
)
333 public void ResetAlternatingBackColor()
339 public void ResetBackColor()
345 public void ResetForeColor()
351 public void ResetGridLineColor()
357 public void ResetHeaderBackColor()
363 public void ResetHeaderFont()
369 public void ResetHeaderForeColor()
375 public void ResetLinkColor()
380 /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
381 // public void ResetLinkHoverColor
384 public void ResetSelectionBackColor()
390 public void ResetSelectionForeColor()
396 protected virtual bool ShouldSerializeAlternatingBackColor()
398 throw new NotImplementedException ();
402 protected bool ShouldSerializeBackColor()
404 throw new NotImplementedException ();
408 protected bool ShouldSerializeForeColor()
410 throw new NotImplementedException ();
414 protected virtual bool ShouldSerializeGridLineColor()
416 throw new NotImplementedException ();
420 protected virtual bool ShouldSerializeHeaderBackColor()
422 throw new NotImplementedException ();
426 protected virtual bool ShouldSerializeHeaderForeColor()
428 throw new NotImplementedException ();
432 protected virtual bool ShouldSerializeLinkColor()
434 throw new NotImplementedException ();
437 /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
438 /// protected virtual bool ShouldSerializeLinkHoverColor();
441 protected bool ShouldSerializePreferredRowHeight()
443 throw new NotImplementedException ();
447 protected bool ShouldSerializeSelectionBackColor()
449 throw new NotImplementedException ();
453 protected virtual bool ShouldSerializeSelectionForeColor()
455 throw new NotImplementedException ();
460 public event EventHandler AllowSortingChanged
;
461 public event EventHandler AlternatingBackColorChanged
;
462 public event EventHandler BackColorChanged
;
463 public event EventHandler ColumnHeadersVisibleChanged
;
464 public event EventHandler ForeColorChanged
;
465 public event EventHandler GridLineColorChanged
;
466 public event EventHandler GridLineStyleChanged
;
467 public event EventHandler HeaderBackColorChanged
;
468 public event EventHandler HeaderFontChanged
;
469 public event EventHandler HeaderForeColorChanged
;
470 public event EventHandler LinkColorChanged
;
472 /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
473 /// public event EventHandler LinkHoverColorChanged;
475 public event EventHandler MappingNameChanged
;
476 public event EventHandler PreferredColumnWidthChanged
;
477 public event EventHandler PreferredRowHeightChanged
;
478 public event EventHandler ReadOnlyChanged
;
479 public event EventHandler RowHeadersVisibleChanged
;
480 public event EventHandler RowHeaderWidthChanged
;
481 public event EventHandler SelectionBackColorChanged
;
482 public event EventHandler SelectionForeColorChanged
;