* TextBoxBase.cs: Take HideSelection into account when
[mono-project.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / DataGridTableStyle.cs
blob540df5b7f0f4c873bf289e8bde1c4148653224f6
1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
8 //
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 // Copyright (c) 2004-2005 Novell, Inc.
22 // Authors:
24 // Peter Bartok <pbartok@novell.com>
25 // Jordi Mas i Hernandez <jordi@ximian.com>
28 // NOT COMPLETE
31 using System.Collections;
32 using System.ComponentModel;
33 using System.Drawing;
34 using System.Runtime.InteropServices;
35 using System.Data;
36 using System.Xml;
37 using System.Runtime.Serialization;
39 namespace System.Windows.Forms
41 [DesignTimeVisible(false)]
42 [ToolboxItem(false)]
43 public class DataGridTableStyle : Component, IDataGridEditingService
45 public static DataGridTableStyle DefaultTableStyle = new DataGridTableStyle (true);
47 #region Local Variables
48 private static readonly Color def_alternating_backcolor = ThemeEngine.Current.DataGridAlternatingBackColor;
49 private static readonly Color def_backcolor = ThemeEngine.Current.DataGridBackColor;
50 private static readonly Color def_forecolor = SystemColors.WindowText;
51 private static readonly Color def_gridline_color = ThemeEngine.Current.DataGridGridLineColor;
52 private static readonly Color def_header_backcolor = ThemeEngine.Current.DataGridHeaderBackColor;
53 private static readonly Font def_header_font = ThemeEngine.Current.DefaultFont;
54 private static readonly Color def_header_forecolor = ThemeEngine.Current.DataGridHeaderForeColor;
55 private static readonly Color def_link_color = ThemeEngine.Current.DataGridLinkColor;
56 private static readonly Color def_link_hovercolor = ThemeEngine.Current.DataGridLinkHoverColor;
57 private static readonly Color def_selection_backcolor = ThemeEngine.Current.DataGridSelectionBackColor;
58 private static readonly Color def_selection_forecolor = ThemeEngine.Current.DataGridSelectionForeColor;
59 private static readonly int def_preferredrow_height = ThemeEngine.Current.DefaultFont.Height + 3;
61 private bool allow_sorting;
62 private DataGrid datagrid;
63 private Color header_forecolor;
64 private string mapping_name;
65 private Color alternating_backcolor;
66 private bool columnheaders_visible;
67 private GridColumnStylesCollection column_styles;
68 private Color gridline_color;
69 private DataGridLineStyle gridline_style;
70 private Color header_backcolor;
71 private Font header_font;
72 private Color link_color;
73 private Color link_hovercolor;
74 private int preferredcolumn_width;
75 private int preferredrow_height;
76 private bool _readonly;
77 private bool rowheaders_visible;
78 private Color selection_backcolor;
79 private Color selection_forecolor;
80 private int rowheaders_width;
81 private Color backcolor;
82 private Color forecolor;
83 private bool is_default;
84 internal ArrayList table_relations;
85 CurrencyManager manager;
86 #endregion // Local Variables
88 #region Constructors
89 public DataGridTableStyle ()
90 : this (false)
94 public DataGridTableStyle (bool isDefaultTableStyle)
96 is_default = isDefaultTableStyle;
97 allow_sorting = true;
98 datagrid = null;
99 header_forecolor = def_header_forecolor;
100 mapping_name = string.Empty;
101 table_relations = new ArrayList ();
102 column_styles = new GridColumnStylesCollection (this);
104 alternating_backcolor = def_alternating_backcolor;
105 columnheaders_visible = true;
106 gridline_color = def_gridline_color;
107 gridline_style = DataGridLineStyle.Solid;
108 header_backcolor = def_header_backcolor;
109 header_font = def_header_font;
110 link_color = def_link_color;
111 link_hovercolor = def_link_hovercolor;
112 preferredcolumn_width = ThemeEngine.Current.DataGridPreferredColumnWidth;
113 preferredrow_height = ThemeEngine.Current.DefaultFont.Height + 3;
114 _readonly = false;
115 rowheaders_visible = true;
116 selection_backcolor = def_selection_backcolor;
117 selection_forecolor = def_selection_forecolor;
118 rowheaders_width = 35;
119 backcolor = def_backcolor;
120 forecolor = def_forecolor;
123 public DataGridTableStyle (CurrencyManager listManager)
124 : this (false)
126 manager = listManager;
128 #endregion
130 #region Public Instance Properties
131 [DefaultValue(true)]
132 public bool AllowSorting {
133 get { return allow_sorting; }
134 set {
135 if (is_default)
136 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
138 if (allow_sorting != value) {
139 allow_sorting = value;
140 OnAllowSortingChanged (EventArgs.Empty);
145 public Color AlternatingBackColor {
146 get { return alternating_backcolor; }
147 set {
148 if (is_default)
149 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
151 if (alternating_backcolor != value) {
152 alternating_backcolor = value;
153 OnAlternatingBackColorChanged (EventArgs.Empty);
158 public Color BackColor {
159 get { return backcolor; }
160 set {
161 if (is_default)
162 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
164 if (backcolor != value) {
165 backcolor = value;
166 // XXX This should be OnBackColorChanged, MS made a c&p error, I think
167 OnForeColorChanged (EventArgs.Empty);
172 [DefaultValue(true)]
173 public bool ColumnHeadersVisible {
174 get {
175 return columnheaders_visible;
178 set {
179 if (columnheaders_visible != value) {
180 columnheaders_visible = value;
181 OnColumnHeadersVisibleChanged (EventArgs.Empty);
186 [Browsable(false)]
187 public virtual DataGrid DataGrid {
188 get { return datagrid; }
189 set {
190 if (datagrid != value) {
191 datagrid = value;
193 /* now set the value on all our column styles */
194 for (int i = 0; i < column_styles.Count; i ++) {
195 column_styles[i].SetDataGridInternal (datagrid);
201 public Color ForeColor {
202 get { return forecolor; }
203 set {
204 if (is_default)
205 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
207 if (forecolor != value) {
208 forecolor = value;
209 // XXX This should be OnForeColorChanged, MS made a c&p error, I think
210 OnBackColorChanged (EventArgs.Empty);
215 [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
216 [Localizable(true)]
217 public virtual GridColumnStylesCollection GridColumnStyles {
218 get { return column_styles; }
221 public Color GridLineColor {
222 get { return gridline_color; }
223 set {
224 if (is_default)
225 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
227 if (gridline_color != value) {
228 gridline_color = value;
229 OnGridLineColorChanged (EventArgs.Empty);
234 [DefaultValue(DataGridLineStyle.Solid)]
235 public DataGridLineStyle GridLineStyle {
236 get { return gridline_style; }
237 set {
238 if (is_default)
239 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
241 if (gridline_style != value) {
242 gridline_style = value;
243 OnGridLineStyleChanged (EventArgs.Empty);
248 public Color HeaderBackColor {
249 get { return header_backcolor; }
250 set {
251 if (is_default)
252 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
254 if (value == Color.Empty) {
255 throw new ArgumentNullException ("Color.Empty value is invalid.");
258 if (header_backcolor != value) {
259 header_backcolor = value;
260 OnHeaderBackColorChanged (EventArgs.Empty);
265 [AmbientValue(null)]
266 [Localizable(true)]
267 public Font HeaderFont {
268 get { return header_font; }
269 set {
270 if (is_default)
271 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
273 if (value == null)
274 value = def_header_font;
276 if (header_font != value) {
277 header_font = value;
278 OnHeaderFontChanged (EventArgs.Empty);
283 public Color HeaderForeColor {
284 get { return header_forecolor; }
285 set {
286 if (is_default)
287 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
289 if (header_forecolor != value) {
290 header_forecolor = value;
291 OnHeaderForeColorChanged (EventArgs.Empty);
296 public Color LinkColor {
297 get { return link_color; }
298 set {
299 if (is_default)
300 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
302 if (link_color != value) {
303 link_color = value;
304 OnLinkColorChanged (EventArgs.Empty);
309 [ComVisible(false)]
310 [EditorBrowsable(EditorBrowsableState.Never)]
311 [Browsable(false)]
312 public Color LinkHoverColor {
313 get { return link_hovercolor; }
314 set {
315 if (link_hovercolor != value) {
316 link_hovercolor = value;
317 // XXX MS doesn't emit this event (even though they should...)
318 // OnLinkHoverColorChanged (EventArgs.Empty);
323 [Editor("System.Windows.Forms.Design.DataGridTableStyleMappingNameEditor, " + Consts.AssemblySystem_Design, typeof(System.Drawing.Design.UITypeEditor))]
324 public string MappingName {
325 get { return mapping_name; }
326 set {
327 if (value == null)
328 value = "";
330 if (mapping_name != value) {
331 mapping_name = value;
332 OnMappingNameChanged (EventArgs.Empty);
337 [DefaultValue(75)]
338 [TypeConverter(typeof(DataGridPreferredColumnWidthTypeConverter))]
339 [Localizable(true)]
340 public int PreferredColumnWidth {
341 get { return preferredcolumn_width; }
342 set {
343 if (is_default)
344 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
346 if (value < 0) {
347 throw new ArgumentException ("PreferredColumnWidth is less than 0");
350 if (preferredcolumn_width != value) {
351 preferredcolumn_width = value;
352 OnPreferredColumnWidthChanged (EventArgs.Empty);
357 [Localizable(true)]
358 public int PreferredRowHeight {
359 get { return preferredrow_height; }
360 set {
361 if (is_default)
362 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
364 if (preferredrow_height != value) {
365 preferredrow_height = value;
366 OnPreferredRowHeightChanged (EventArgs.Empty);
371 [DefaultValue(false)]
372 public virtual bool ReadOnly {
373 get { return _readonly; }
374 set {
375 if (_readonly != value) {
376 _readonly = value;
377 OnReadOnlyChanged (EventArgs.Empty);
382 [DefaultValue(true)]
383 public bool RowHeadersVisible {
384 get { return rowheaders_visible; }
385 set {
386 if (rowheaders_visible != value) {
387 rowheaders_visible = value;
388 OnRowHeadersVisibleChanged (EventArgs.Empty);
393 [DefaultValue(35)]
394 [Localizable(true)]
395 public int RowHeaderWidth {
396 get { return rowheaders_width; }
397 set {
398 if (rowheaders_width != value) {
399 rowheaders_width = value;
400 OnRowHeaderWidthChanged (EventArgs.Empty);
405 public Color SelectionBackColor {
406 get { return selection_backcolor; }
407 set {
408 if (is_default)
409 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
411 if (selection_backcolor != value) {
412 selection_backcolor = value;
413 OnSelectionBackColorChanged (EventArgs.Empty);
418 [Description("The foreground color for the current data grid row")]
419 public Color SelectionForeColor {
420 get { return selection_forecolor; }
421 set {
422 if (is_default)
423 throw new ArgumentException ("Cannot change the value of this property on the default DataGridTableStyle.");
425 if (selection_forecolor != value) {
426 selection_forecolor = value;
427 OnSelectionForeColorChanged (EventArgs.Empty);
432 #endregion // Public Instance Properties
434 #region Private Instance Properties
435 internal DataGridLineStyle CurrentGridLineStyle {
436 get {
437 if (is_default && datagrid != null) {
438 return datagrid.GridLineStyle;
441 return gridline_style;
445 internal Color CurrentGridLineColor {
446 get {
447 if (is_default && datagrid != null) {
448 return datagrid.GridLineColor;
451 return gridline_color;
455 internal Color CurrentHeaderBackColor {
456 get {
457 if (is_default && datagrid != null) {
458 return datagrid.HeaderBackColor;
461 return header_backcolor;
465 internal Color CurrentHeaderForeColor {
466 get {
467 if (is_default && datagrid != null) {
468 return datagrid.HeaderForeColor;
471 return header_forecolor;
475 internal int CurrentPreferredColumnWidth {
476 get {
477 if (is_default && datagrid != null) {
478 return datagrid.PreferredColumnWidth;
481 return preferredcolumn_width;
485 internal int CurrentPreferredRowHeight {
486 get {
487 if (is_default && datagrid != null) {
488 return datagrid.PreferredRowHeight;
491 return preferredrow_height;
495 internal bool CurrentRowHeadersVisible {
496 get {
497 if (is_default && datagrid != null) {
498 return datagrid.RowHeadersVisible;
501 return rowheaders_visible;
505 internal bool HasRelations {
506 get { return table_relations.Count > 0; }
509 internal string[] Relations {
510 get {
511 string[] rel = new string[table_relations.Count];
512 table_relations.CopyTo (rel, 0);
513 return rel;
517 #endregion Private Instance Properties
519 #region Public Instance Methods
521 [MonoTODO]
522 public bool BeginEdit (DataGridColumnStyle gridColumn, int rowNumber)
524 throw new NotImplementedException ();
527 protected internal virtual DataGridColumnStyle CreateGridColumn (PropertyDescriptor prop)
529 return CreateGridColumn (prop, false);
532 protected internal virtual DataGridColumnStyle CreateGridColumn (PropertyDescriptor prop, bool isDefault)
534 if (prop.PropertyType == typeof (bool))
535 return new DataGridBoolColumn (prop, isDefault);
536 else {
537 // At least to special cases with formats
538 if (prop.PropertyType.Equals (typeof (DateTime))) {
539 return new DataGridTextBoxColumn (prop, "d", isDefault);
542 if (prop.PropertyType.Equals (typeof (Int32)) ||
543 prop.PropertyType.Equals (typeof (Int16))) {
544 return new DataGridTextBoxColumn (prop, "G", isDefault);
547 return new DataGridTextBoxColumn (prop, isDefault);
551 protected override void Dispose (bool disposing)
553 base.Dispose (disposing);
556 [MonoTODO]
557 public bool EndEdit ( DataGridColumnStyle gridColumn, int rowNumber, bool shouldAbort)
559 throw new NotImplementedException ();
562 protected virtual void OnAllowSortingChanged (EventArgs e)
564 EventHandler eh = (EventHandler)(Events [AllowSortingChangedEvent]);
565 if (eh != null)
566 eh (this, e);
569 protected virtual void OnAlternatingBackColorChanged (EventArgs e)
571 EventHandler eh = (EventHandler)(Events [AlternatingBackColorChangedEvent]);
572 if (eh != null)
573 eh (this, e);
576 protected virtual void OnBackColorChanged (EventArgs e)
578 EventHandler eh = (EventHandler)(Events [BackColorChangedEvent]);
579 if (eh != null)
580 eh (this, e);
583 protected virtual void OnColumnHeadersVisibleChanged (EventArgs e)
585 EventHandler eh = (EventHandler)(Events [ColumnHeadersVisibleChangedEvent]);
586 if (eh != null)
587 eh (this, e);
590 protected virtual void OnForeColorChanged (EventArgs e)
592 EventHandler eh = (EventHandler)(Events [ForeColorChangedEvent]);
593 if (eh != null)
594 eh (this, e);
597 protected virtual void OnGridLineColorChanged (EventArgs e)
599 EventHandler eh = (EventHandler)(Events [GridLineColorChangedEvent]);
600 if (eh != null)
601 eh (this, e);
604 protected virtual void OnGridLineStyleChanged (EventArgs e)
606 EventHandler eh = (EventHandler)(Events [GridLineStyleChangedEvent]);
607 if (eh != null)
608 eh (this, e);
611 protected virtual void OnHeaderBackColorChanged (EventArgs e)
613 EventHandler eh = (EventHandler)(Events [HeaderBackColorChangedEvent]);
614 if (eh != null)
615 eh (this, e);
618 protected virtual void OnHeaderFontChanged (EventArgs e)
620 EventHandler eh = (EventHandler)(Events [HeaderFontChangedEvent]);
621 if (eh != null)
622 eh (this, e);
625 protected virtual void OnHeaderForeColorChanged (EventArgs e)
627 EventHandler eh = (EventHandler)(Events [HeaderForeColorChangedEvent]);
628 if (eh != null)
629 eh (this, e);
632 protected virtual void OnLinkColorChanged (EventArgs e)
634 EventHandler eh = (EventHandler)(Events [LinkColorChangedEvent]);
635 if (eh != null)
636 eh (this, e);
639 protected virtual void OnLinkHoverColorChanged (EventArgs e)
641 EventHandler eh = (EventHandler)(Events [LinkHoverColorChangedEvent]);
642 if (eh != null)
643 eh (this, e);
646 protected virtual void OnMappingNameChanged (EventArgs e)
648 EventHandler eh = (EventHandler)(Events [MappingNameChangedEvent]);
649 if (eh != null)
650 eh (this, e);
653 protected virtual void OnPreferredColumnWidthChanged (EventArgs e)
655 EventHandler eh = (EventHandler)(Events [PreferredColumnWidthChangedEvent]);
656 if (eh != null)
657 eh (this, e);
660 protected virtual void OnPreferredRowHeightChanged (EventArgs e)
662 EventHandler eh = (EventHandler)(Events [PreferredRowHeightChangedEvent]);
663 if (eh != null)
664 eh (this, e);
667 protected virtual void OnReadOnlyChanged (EventArgs e)
669 EventHandler eh = (EventHandler)(Events [ReadOnlyChangedEvent]);
670 if (eh != null)
671 eh (this, e);
674 protected virtual void OnRowHeadersVisibleChanged (EventArgs e)
676 EventHandler eh = (EventHandler)(Events [RowHeadersVisibleChangedEvent]);
677 if (eh != null)
678 eh (this, e);
681 protected virtual void OnRowHeaderWidthChanged (EventArgs e)
683 EventHandler eh = (EventHandler)(Events [RowHeaderWidthChangedEvent]);
684 if (eh != null)
685 eh (this, e);
688 protected virtual void OnSelectionBackColorChanged (EventArgs e)
690 EventHandler eh = (EventHandler)(Events [SelectionBackColorChangedEvent]);
691 if (eh != null)
692 eh (this, e);
695 protected virtual void OnSelectionForeColorChanged (EventArgs e)
697 EventHandler eh = (EventHandler)(Events [SelectionForeColorChangedEvent]);
698 if (eh != null)
699 eh (this, e);
702 public void ResetAlternatingBackColor ()
704 AlternatingBackColor = def_alternating_backcolor;
707 public void ResetBackColor ()
709 BackColor = def_backcolor;
712 public void ResetForeColor ()
714 ForeColor = def_forecolor;
717 public void ResetGridLineColor ()
719 GridLineColor = def_gridline_color;
722 public void ResetHeaderBackColor ()
724 HeaderBackColor = def_header_backcolor;
727 public void ResetHeaderFont ()
729 HeaderFont = def_header_font;
732 public void ResetHeaderForeColor ()
734 HeaderForeColor = def_header_forecolor;
737 public void ResetLinkColor ()
739 LinkColor = def_link_color;
742 public void ResetLinkHoverColor ()
744 LinkHoverColor = def_link_hovercolor;
747 public void ResetSelectionBackColor ()
749 SelectionBackColor = def_selection_backcolor;
752 public void ResetSelectionForeColor ()
754 SelectionForeColor = def_selection_forecolor;
757 protected virtual bool ShouldSerializeAlternatingBackColor ()
759 return (alternating_backcolor != def_alternating_backcolor);
762 protected bool ShouldSerializeBackColor ()
764 return (backcolor != def_backcolor);
767 protected bool ShouldSerializeForeColor ()
769 return (forecolor != def_forecolor);
772 protected virtual bool ShouldSerializeGridLineColor ()
774 return (gridline_color != def_gridline_color);
777 protected virtual bool ShouldSerializeHeaderBackColor ()
779 return (header_backcolor != def_header_backcolor);
782 protected virtual bool ShouldSerializeHeaderForeColor ()
784 return (header_forecolor != def_header_forecolor);
787 protected virtual bool ShouldSerializeLinkColor ()
789 return (link_color != def_link_color);
792 protected virtual bool ShouldSerializeLinkHoverColor ()
794 return (link_hovercolor != def_link_hovercolor);
797 protected bool ShouldSerializePreferredRowHeight ()
799 return (preferredrow_height != def_preferredrow_height);
802 protected bool ShouldSerializeSelectionBackColor ()
804 return (selection_backcolor != def_selection_backcolor);
807 protected virtual bool ShouldSerializeSelectionForeColor ()
809 return (selection_forecolor != def_selection_forecolor);
811 #endregion // Protected Instance Methods
813 #region Private Instance Properties
814 // Create column styles for this TableStyle
815 internal void CreateColumnsForTable (bool onlyBind)
817 CurrencyManager mgr = manager;
818 DataGridColumnStyle st;
820 if (mgr == null) {
821 mgr = datagrid.ListManager;
823 if (mgr == null)
824 return;
827 for (int i = 0; i < column_styles.Count; i ++)
828 column_styles[i].bound = false;
830 table_relations.Clear ();
831 PropertyDescriptorCollection propcol = mgr.GetItemProperties ();
833 for (int i = 0; i < propcol.Count; i++)
835 // The column style is already provided by the user
836 st = column_styles[propcol[i].Name];
837 if (st != null) {
838 if (st.Width == -1)
839 st.Width = CurrentPreferredColumnWidth;
841 st.PropertyDescriptor = propcol[i];
842 st.bound = true;
843 continue;
846 if (onlyBind == true)
847 continue;
849 if (typeof (IBindingList).IsAssignableFrom (propcol[i].PropertyType)) {
850 table_relations.Add (propcol[i].Name);
851 } else {
852 st = CreateGridColumn (propcol[i], true);
853 st.bound = true;
854 st.grid = datagrid;
855 st.MappingName = propcol[i].Name;
856 st.HeaderText = propcol[i].Name;
857 st.Width = CurrentPreferredColumnWidth;
858 column_styles.Add (st);
864 #endregion Private Instance Properties
866 #region Events
867 static object AllowSortingChangedEvent = new object ();
868 static object AlternatingBackColorChangedEvent = new object ();
869 static object BackColorChangedEvent = new object ();
870 static object ColumnHeadersVisibleChangedEvent = new object ();
871 static object ForeColorChangedEvent = new object ();
872 static object GridLineColorChangedEvent = new object ();
873 static object GridLineStyleChangedEvent = new object ();
874 static object HeaderBackColorChangedEvent = new object ();
875 static object HeaderFontChangedEvent = new object ();
876 static object HeaderForeColorChangedEvent = new object ();
877 static object LinkColorChangedEvent = new object ();
878 static object LinkHoverColorChangedEvent = new object ();
879 static object MappingNameChangedEvent = new object ();
880 static object PreferredColumnWidthChangedEvent = new object ();
881 static object PreferredRowHeightChangedEvent = new object ();
882 static object ReadOnlyChangedEvent = new object ();
883 static object RowHeadersVisibleChangedEvent = new object ();
884 static object RowHeaderWidthChangedEvent = new object ();
885 static object SelectionBackColorChangedEvent = new object ();
886 static object SelectionForeColorChangedEvent = new object ();
888 public event EventHandler AllowSortingChanged {
889 add { Events.AddHandler (AllowSortingChangedEvent, value); }
890 remove { Events.RemoveHandler (AllowSortingChangedEvent, value); }
893 public event EventHandler AlternatingBackColorChanged {
894 add { Events.AddHandler (AlternatingBackColorChangedEvent, value); }
895 remove { Events.RemoveHandler (AlternatingBackColorChangedEvent, value); }
898 public event EventHandler BackColorChanged {
899 add { Events.AddHandler (BackColorChangedEvent, value); }
900 remove { Events.RemoveHandler (BackColorChangedEvent, value); }
903 public event EventHandler ColumnHeadersVisibleChanged {
904 add { Events.AddHandler (ColumnHeadersVisibleChangedEvent, value); }
905 remove { Events.RemoveHandler (ColumnHeadersVisibleChangedEvent, value); }
908 public event EventHandler ForeColorChanged {
909 add { Events.AddHandler (ForeColorChangedEvent, value); }
910 remove { Events.RemoveHandler (ForeColorChangedEvent, value); }
913 public event EventHandler GridLineColorChanged {
914 add { Events.AddHandler (GridLineColorChangedEvent, value); }
915 remove { Events.RemoveHandler (GridLineColorChangedEvent, value); }
918 public event EventHandler GridLineStyleChanged {
919 add { Events.AddHandler (GridLineStyleChangedEvent, value); }
920 remove { Events.RemoveHandler (GridLineStyleChangedEvent, value); }
923 public event EventHandler HeaderBackColorChanged {
924 add { Events.AddHandler (HeaderBackColorChangedEvent, value); }
925 remove { Events.RemoveHandler (HeaderBackColorChangedEvent, value); }
928 public event EventHandler HeaderFontChanged {
929 add { Events.AddHandler (HeaderFontChangedEvent, value); }
930 remove { Events.RemoveHandler (HeaderFontChangedEvent, value); }
933 public event EventHandler HeaderForeColorChanged {
934 add { Events.AddHandler (HeaderForeColorChangedEvent, value); }
935 remove { Events.RemoveHandler (HeaderForeColorChangedEvent, value); }
938 public event EventHandler LinkColorChanged {
939 add { Events.AddHandler (LinkColorChangedEvent, value); }
940 remove { Events.RemoveHandler (LinkColorChangedEvent, value); }
943 public event EventHandler LinkHoverColorChanged {
944 add { Events.AddHandler (LinkHoverColorChangedEvent, value); }
945 remove { Events.RemoveHandler (LinkHoverColorChangedEvent, value); }
948 public event EventHandler MappingNameChanged {
949 add { Events.AddHandler (MappingNameChangedEvent, value); }
950 remove { Events.RemoveHandler (MappingNameChangedEvent, value); }
953 public event EventHandler PreferredColumnWidthChanged {
954 add { Events.AddHandler (PreferredColumnWidthChangedEvent, value); }
955 remove { Events.RemoveHandler (PreferredColumnWidthChangedEvent, value); }
958 public event EventHandler PreferredRowHeightChanged {
959 add { Events.AddHandler (PreferredRowHeightChangedEvent, value); }
960 remove { Events.RemoveHandler (PreferredRowHeightChangedEvent, value); }
963 public event EventHandler ReadOnlyChanged {
964 add { Events.AddHandler (ReadOnlyChangedEvent, value); }
965 remove { Events.RemoveHandler (ReadOnlyChangedEvent, value); }
968 public event EventHandler RowHeadersVisibleChanged {
969 add { Events.AddHandler (RowHeadersVisibleChangedEvent, value); }
970 remove { Events.RemoveHandler (RowHeadersVisibleChangedEvent, value); }
973 public event EventHandler RowHeaderWidthChanged {
974 add { Events.AddHandler (RowHeaderWidthChangedEvent, value); }
975 remove { Events.RemoveHandler (RowHeaderWidthChangedEvent, value); }
978 public event EventHandler SelectionBackColorChanged {
979 add { Events.AddHandler (SelectionBackColorChangedEvent, value); }
980 remove { Events.RemoveHandler (SelectionBackColorChangedEvent, value); }
983 public event EventHandler SelectionForeColorChanged {
984 add { Events.AddHandler (SelectionForeColorChangedEvent, value); }
985 remove { Events.RemoveHandler (SelectionForeColorChangedEvent, value); }
987 #endregion // Events