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
12 // Permission is hereby granted, free of charge, to any person obtaining
13 // a copy of this software and associated documentation files (the
14 // "Software"), to deal in the Software without restriction, including
15 // without limitation the rights to use, copy, modify, merge, publish,
16 // distribute, sublicense, and/or sell copies of the Software, and to
17 // permit persons to whom the Software is furnished to do so, subject to
18 // the following conditions:
20 // The above copyright notice and this permission notice shall be
21 // included in all copies or substantial portions of the Software.
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
27 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
28 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 using System
.ComponentModel
;
34 using System
.Collections
;
36 namespace System
.Windows
.Forms
{
39 /// Represents the table drawn by the System.Windows.Forms.DataGrid control at run time.
43 public class DataGridTableStyle
: Component
{
46 // This member supports the .NET Framework infrastructure and is not intended to be used directly from your code:
47 public static DataGridTableStyle DefaultTableStyle
;
49 Color alternatingBackColor
;
51 bool columnHeadersVisible
;
55 DataGridLineStyle gridLineStyle
;
56 Color headerBackColor
;
58 Color headerForeColor
;
61 int preferredColumnWidth
;
62 int preferredRowHeight
;
64 bool rowHeadersVisible
;
66 Color selectionBackColor
;
67 Color selectionForeColor
;
72 public DataGridTableStyle()
75 alternatingBackColor
=SystemColors
.Window
;
76 gridLineStyle
=DataGridLineStyle
.Solid
;
77 rowHeadersVisible
=true;
80 // This member supports the .NET Framework infrastructure and is not intended to be used directly from your code:
82 public DataGridTableStyle(bool isDefaultTableStyle
){
86 public DataGridTableStyle(CurrencyManager listManager
) : this()
93 public bool AllowSorting
{
94 get { return allowSorting; }
95 set { allowSorting=value; }
98 public Color AlternatingBackColor
{
99 get { return alternatingBackColor; }
100 set { alternatingBackColor=value; }
103 public Color BackColor
{
104 get { return backColor; }
105 set { backColor=value; }
108 public bool ColumnHeadersVisible
{
109 get { return columnHeadersVisible; }
110 set { columnHeadersVisible=value; }
113 public virtual DataGrid DataGrid
{
114 get { return dataGrid; }
115 set { dataGrid=value; }
118 public Color ForeColor
{
119 get { return foreColor; }
120 set { foreColor=value; }
124 public virtual GridColumnStylesCollection GridColumnStyles
{
125 get { throw new NotImplementedException (); }
128 public Color GridLineColor
{
129 get { return gridLineColor; }
130 set { gridLineColor=value; }
133 public DataGridLineStyle GridLineStyle
{
134 get { return gridLineStyle; }
135 set { gridLineStyle=value; }
138 public Color HeaderBackColor
{
139 get { return headerBackColor; }
140 set { headerBackColor=value; }
143 public Font HeaderFont
{
144 get { return headerFont; }
145 set { headerFont=value; }
148 public Color HeaderForeColor
{
149 get { return headerForeColor; }
150 set { headerForeColor=value; }
153 public Color LinkColor
{
154 get { return linkColor; }
155 set { linkColor=value; }
158 // This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
160 public Color LinkHoverColor
{
162 throw new NotImplementedException ();
168 public string MappingName
{
169 get { return mappingName; }
170 set { mappingName=value; }
173 public int PreferredColumnWidth
{
174 get { return preferredColumnWidth; }
175 set { preferredColumnWidth=value; }
178 public int PreferredRowHeight
{
179 get { return preferredRowHeight; }
180 set { preferredRowHeight=value; }
183 public virtual bool ReadOnly
{
184 get { return allowSorting; }
185 set { allowSorting=value; }
188 public bool RowHeadersVisible
{
189 get { return rowHeadersVisible; }
190 set { rowHeadersVisible=value; }
194 public int RowHeaderWidth
{
195 get { return rowHeaderWidth; }
196 set { rowHeaderWidth=value; }
199 public Color SelectionBackColor
{
200 get { return selectionBackColor; }
201 set { selectionBackColor=value; }
204 public Color SelectionForeColor
{
205 get { return selectionForeColor; }
206 set { selectionForeColor=value; }
212 public virtual bool BeginEdit(DataGridColumnStyle gridColumn
,int rowNumber
)
214 throw new NotImplementedException ();
218 protected internal virtual DataGridColumnStyle
CreateGridColumn(PropertyDescriptor prop
)
220 throw new NotImplementedException ();
224 protected internal virtual DataGridColumnStyle
CreateGridColumn(PropertyDescriptor prop
,bool isDefault
)
226 throw new NotImplementedException ();
230 protected override void Dispose(bool disposing
)
233 base.Dispose(disposing
);;
237 public virtual bool EndEdit(DataGridColumnStyle gridColumn
,int rowNumber
,bool shouldAbort
)
239 throw new NotImplementedException ();
243 protected virtual void OnAllowSortingChanged(EventArgs e
)
249 protected virtual void OnAlternatingBackColorChanged(EventArgs e
)
255 protected virtual void OnBackColorChanged(EventArgs e
)
261 protected virtual void OnColumnHeadersVisibleChanged(EventArgs e
)
267 protected virtual void OnForeColorChanged(EventArgs e
)
273 protected virtual void OnGridLineColorChanged(EventArgs e
)
279 protected virtual void OnGridLineStyleChanged(EventArgs e
)
285 protected virtual void OnHeaderBackColorChanged(EventArgs e
)
291 protected virtual void OnHeaderFontChanged(EventArgs e
)
297 protected virtual void OnHeaderForeColorChanged(EventArgs e
)
303 protected virtual void OnLinkColorChanged(EventArgs e
)
309 protected virtual void OnLinkHoverColorChanged(EventArgs e
)
315 protected virtual void OnMappingNameChanged(EventArgs e
)
321 protected virtual void OnPreferredColumnWidthChanged(EventArgs e
)
327 protected virtual void OnPreferredRowHeightChanged(EventArgs e
)
333 protected virtual void OnReadOnlyChanged(EventArgs e
)
339 protected virtual void OnRowHeadersVisibleChanged(EventArgs e
)
345 protected virtual void OnRowHeaderWidthChanged(EventArgs e
)
351 protected virtual void OnSelectionBackColorChanged(EventArgs e
)
357 protected virtual void OnSelectionForeColorChanged(EventArgs e
)
363 public void ResetAlternatingBackColor()
369 public void ResetBackColor()
375 public void ResetForeColor()
381 public void ResetGridLineColor()
387 public void ResetHeaderBackColor()
393 public void ResetHeaderFont()
399 public void ResetHeaderForeColor()
405 public void ResetLinkColor()
410 /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
411 public void ResetLinkHoverColor(){
415 public void ResetSelectionBackColor()
421 public void ResetSelectionForeColor()
427 protected virtual bool ShouldSerializeAlternatingBackColor()
429 throw new NotImplementedException ();
433 protected bool ShouldSerializeBackColor()
435 throw new NotImplementedException ();
439 protected bool ShouldSerializeForeColor()
441 throw new NotImplementedException ();
445 protected virtual bool ShouldSerializeGridLineColor()
447 throw new NotImplementedException ();
451 protected virtual bool ShouldSerializeHeaderBackColor()
453 throw new NotImplementedException ();
457 protected virtual bool ShouldSerializeHeaderForeColor()
459 throw new NotImplementedException ();
463 protected virtual bool ShouldSerializeLinkColor()
465 throw new NotImplementedException ();
468 /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
470 protected virtual bool ShouldSerializeLinkHoverColor(){
471 throw new NotImplementedException ();
475 protected bool ShouldSerializePreferredRowHeight()
477 throw new NotImplementedException ();
481 protected bool ShouldSerializeSelectionBackColor()
483 throw new NotImplementedException ();
487 protected virtual bool ShouldSerializeSelectionForeColor()
489 throw new NotImplementedException ();
494 public event EventHandler AllowSortingChanged
;
495 public event EventHandler AlternatingBackColorChanged
;
496 public event EventHandler BackColorChanged
;
497 public event EventHandler ColumnHeadersVisibleChanged
;
498 public event EventHandler ForeColorChanged
;
499 public event EventHandler GridLineColorChanged
;
500 public event EventHandler GridLineStyleChanged
;
501 public event EventHandler HeaderBackColorChanged
;
502 public event EventHandler HeaderFontChanged
;
503 public event EventHandler HeaderForeColorChanged
;
504 public event EventHandler LinkColorChanged
;
506 /// This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
507 public event EventHandler LinkHoverColorChanged
;
509 public event EventHandler MappingNameChanged
;
510 public event EventHandler PreferredColumnWidthChanged
;
511 public event EventHandler PreferredRowHeightChanged
;
512 public event EventHandler ReadOnlyChanged
;
513 public event EventHandler RowHeadersVisibleChanged
;
514 public event EventHandler RowHeaderWidthChanged
;
515 public event EventHandler SelectionBackColorChanged
;
516 public event EventHandler SelectionForeColorChanged
;