2 // System.Windows.Forms.DataGridColumnStyle
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 /// Specifies the appearance and text formatting and behavior of a System.Windows.Forms.DataGrid control column. This class is abstract.
22 public abstract class DataGridColumnStyle
: Component
, IDataGridColumnStyleEditingNotificationService
{
25 HorizontalAlignment alignment
;
26 DataGridTableStyle dataGridTableStyle
;
31 PropertyDescriptor propertyDescriptor
;
38 public DataGridColumnStyle()
40 alignment
=HorizontalAlignment
.Left
;
41 dataGridTableStyle
=null;
48 public DataGridColumnStyle(PropertyDescriptor prop
) : this()
50 propertyDescriptor
=prop
;
55 public virtual HorizontalAlignment Alignment
{
56 get { return alignment; }
57 set { alignment=value; }
60 public virtual DataGridTableStyle DataGridTableStyle
{
61 get { return dataGridTableStyle; }
64 protected int FontHeight
{
65 get { return fontHeight; }
68 * This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
69 public AccessibleObject HeaderAccessibleObject {get;}
72 public virtual string HeaderText
{
73 get { return headerText; }
74 set { headerText=value; }
77 public string MappingName
{
78 get { return mappingName; }
79 set { mappingName=value; }
82 public virtual string NullText
{
83 get { return nullText; }
84 set { nullText=value; }
87 public virtual PropertyDescriptor PropertyDescriptor
{
88 get { return propertyDescriptor; }
89 set { propertyDescriptor=value; }
92 public virtual bool ReadOnly
{
93 get { return readOnly; }
94 set { readOnly=value; }
97 public virtual int Width
{
104 protected internal abstract void Abort(int rowNum
);
107 protected void BeginUpdate()
113 protected void CheckValidDataSource(CurrencyManager
value)
119 protected internal virtual void ColumnStartedEditing(Control editingControl
)
124 protected internal abstract bool Commit(CurrencyManager dataSource
,int rowNum
);
127 protected internal virtual void ConcedeFocus()
133 * This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
134 protected virtual AccessibleObject CreateHeaderAccessibleObject()
138 protected internal virtual void Edit(CurrencyManager source
) {
143 protected internal virtual void Edit(CurrencyManager source
, int rowNum
) {
148 protected internal abstract void Edit(CurrencyManager source
, int rowNum
, Rectangle bounds
,
149 bool readOnly
, string instantText
, bool cellIsVisible
);
152 protected void EndUpdate()
158 protected internal virtual void EnterNullValue()
164 protected internal virtual object GetColumnValueAtRow(CurrencyManager source
,int rowNum
)
166 throw new NotImplementedException ();
169 protected internal abstract int GetMinimumHeight();
171 protected internal abstract int GetPreferredHeight(Graphics g
,object value);
173 protected internal abstract Size
GetPreferredSize(Graphics g
,object value);
176 * This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
179 void IDataGridColumnStyleEditingNotificationService
.ColumnStartedEditing(Control editingControl
)
185 protected virtual void Invalidate()
190 protected internal abstract void Paint(Graphics g
,Rectangle bounds
,CurrencyManager source
,int rowNum
);
192 protected internal abstract void Paint(Graphics g
,Rectangle bounds
,CurrencyManager source
,int rowNum
,bool alignToRight
);
195 protected internal virtual void Paint(Graphics g
, Rectangle bounds
, CurrencyManager source
,
196 int rowNum
, Brush backBrush
, Brush foreBrush
, bool alignToRight
) {
201 public void ResetHeaderText()
207 protected internal virtual void SetColumnValueAtRow(CurrencyManager source
,int rowNum
,object value)
213 protected virtual void SetDataGrid(DataGrid
value)
219 protected virtual void SetDataGridInColumn(DataGrid
value)
225 protected internal virtual void UpdateUI(CurrencyManager source
,int rowNum
,string instantText
) {
232 public event EventHandler AlignmentChanged
;
234 /* This member supports the .NET Framework infrastructure and is not intended to be used directly from your code
235 public event EventHandler FontChanged;
238 public event EventHandler HeaderTextChanged
;
239 public event EventHandler MappingNameChanged
;
240 public event EventHandler NullTextChanged
;
241 public event EventHandler PropertyDescriptorChanged
;
242 public event EventHandler ReadOnlyChanged
;
243 public event EventHandler WidthChanged
;
247 /// This type supports the .NET Framework infrastructure and is not intended to be used directly from your code.
249 /// protected class DataGridColumnStyle.CompModSwitches;
250 /// protected class DataGridColumnStyle.DataGridColumnHeaderAccessibleObject : AccessibleObject;