Specifies the appearance, text formatting, and behavior of a System.Windows.Forms.DataGrid control column. This class is abstract.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Gets or sets the alignment of text in a column.
Gets a value indicating whether the component can raise an event.(Inherited from Component.)
Gets the DataGridTableStyle for the column.
Gets the height of the column's font.
This API supports the product infrastructure and is not intended to be used directly from your code. Gets the AccessibleObject for the column.
Gets or sets the text of the column header.
Gets or sets the name of the data member to map the column style to.
Gets or sets the text that is displayed when the column contains null.
Gets or sets the PropertyDescriptor that determines the attributes of data displayed by the .
Gets or sets a value indicating whether the data in the column can be edited.
Gets or sets the width of the column.
When overridden in a derived class, initiates a request to interrupt an edit procedure.
Suspends the painting of the column until the EndUpdate method is called.
Throws an exception if the System.Windows.Forms.DataGrid does not have a valid data source, or if this column is not mapped to a valid property in the data source.
Informs the System.Windows.Forms.DataGrid that the user has begun editing the column.
When overridden in a derived class, initiates a request to complete an editing procedure.
Notifies a column that it must relinquish the focus to the control it is hosting.
Gets the AccessibleObject for the column.
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.)
|Edit(CurrencyManager, Int32, Rectangle, Boolean)|
Prepares a cell for editing.
|Edit(CurrencyManager, Int32, Rectangle, Boolean, String)|
|Edit(CurrencyManager, Int32, Rectangle, Boolean, String, Boolean)|
When overridden in a deriving class, prepares a cell for editing.
Resumes the painting of columns suspended by calling the BeginUpdate method.
Enters a DBNull.Value into the column.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Gets the value in the specified row from the specified CurrencyManager.
Serves as the default hash function. (Inherited from Object.)
Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.)
When overridden in a derived class, gets the minimum height of a row.
When overridden in a derived class, gets the height used for automatically resizing columns.
When overridden in a derived class, gets the width and height of the specified value. The width and height are used when the user navigates to DataGridTableStyle using the .
Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.)
Redraws the column and causes a paint message to be sent to the control.
|Paint(Graphics, Rectangle, CurrencyManager, Int32)|
|Paint(Graphics, Rectangle, CurrencyManager, Int32, Boolean)|
|Paint(Graphics, Rectangle, CurrencyManager, Int32, Brush, Brush, Boolean)|
Allows the column to free resources when the control it hosts is not needed.
Resets the HeaderText to its default value, null.
|SetColumnValueAtRow(CurrencyManager, Int32, Object)|
Sets the value in a specified row with the value from a specified CurrencyManager.
Sets the System.Windows.Forms.DataGrid control that this column belongs to.
Sets the System.Windows.Forms.DataGrid for the column.
|UpdateUI(CurrencyManager, Int32, String)|
Updates the value of a specified row with the given text.
Occurs when the Alignment property value changes.
Occurs when the column's font changes.
Occurs when the HeaderText property value changes.
Occurs when the MappingName value changes.
Occurs when the NullText value changes.
Occurs when the PropertyDescriptor property value changes.
Occurs when the ReadOnly property value changes.
Occurs when the Width property value changes.
Informs the DataGrid control that the user has begun editing the column.
The System.Windows.Forms.DataGrid control automatically creates a collection of objects for you when you set the DataSource property to an appropriate data source. The objects created actually are instances of one of the following classes that inherit from : DataGridBoolColumn or DataGridTextBoxColumn class.
To format the data display, set the Format property of the DataGridTextBoxColumn class to one of the formatting values. For more information about valid formatting values, see Formatting Types in the .NET Framework and Custom Date and Time Format Strings.
You can also create your own set of GridColumnStylesCollection. When you do so, you must set the MappingName of each column style to the ColumnName of a DataColumn to synchronize the display of columns with the actual data.objects and add them to the
Always create GridColumnStylesCollection before adding DataGridTableStyle objects to the GridTableStylesCollection. When you add an empty DataGridTableStyle with a valid MappingName value to the collection, objects are automatically generated for you. Consequently, an exception will be thrown if you try to add new objects with duplicate MappingName values to the GridColumnStylesCollection.objects and add them to the
When one of the derived classes is instantiated by a System.Windows.Forms.DataGrid control, the class created depends on the DataType of the DataColumn associated with the object. For example, a DataColumn with its DataType set to System.Boolean will be associated with a DataGridBoolColumn. To determine the type of any , use the GetType method.
To create your own column classes, you can inherit from DataGridTextBox class, which hosts the TextBox control. For example, you can host an Image control to show pictures in columns, or you can create your own user control to host in the column.. You might want to do this in order to create special columns that host controls, as exemplified by the
The functionality of the DataColumn. Whereas the DataColumn contains the properties and methods appropriate to creating a data table's schema, the contains the properties and methods related to the appearance of an individual column on the screen.shouldn't be confused with that of the
The BeginUpdate and EndUpdate methods temporarily suspend the drawing of the column while large updates are being made to the column's data. Without this functionality, every change in every cell of the grid would be immediately drawn; this could be distracting to the user and a performance liability.class also allows you to specify the behavior of a column while its data is being changed. The
Most of the properties and methods of the class are tailored to controlling a column's appearance. But a few, such as the GetColumnValueAtRow and SetColumnValueAtRow allow you to examine and change the value in a specified cell.
Notes to Implementers:
Available since 1.1
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.