Class GridBoundColumn
GridBoundColumn provides information for a column to be used in a GridDataBoundGrid. GridBoundColumn can be customized with the visual studio designer where you can change header text, mapping name, and formatting of a column.
Inheritance
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridBoundColumn : Component, ICurrencyManagerSource, ICloneable
Constructors
GridBoundColumn()
Initializes an empty GridBoundColumn instance.
Declaration
public GridBoundColumn()
GridBoundColumn(PropertyDescriptor)
Initializes a GridBoundColumn with a PropertyDescriptor this column should be associated with.
Declaration
public GridBoundColumn(PropertyDescriptor prop)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ComponentModel.PropertyDescriptor | prop | The PropertyDescriptor that defines the data to be displayed in the column. |
Properties
BackColor
Gets or sets the backColor of the GridBoundColumn
Declaration
public Color BackColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
Examples
This example shows how to use the BackColor property.
// Sets back-color depending on the index.
this.gridDataBoundGrid1.Model.ColStyles[1].BackColor = Color.Red;
' Sets back-color depending on the index.
Me.gridDataBoundGrid1.Model.ColStyles(1).BackColor = Color.Red
HeaderText
Gets or sets the header text to be displayed in the column header.
Declaration
public virtual string HeaderText { get; set; }
Property Value
| Type |
|---|
| System.String |
Hidden
Gets or sets the hidden state of the GridBoundColumn
Declaration
public bool Hidden { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
MappingName
Gets or sets the mapping for this column. You should specify which column of a System.Data.DataTable you want to display in the grid at this column.
Declaration
public string MappingName { get; set; }
Property Value
| Type |
|---|
| System.String |
Owner
Gets or sets a GridModelDataBinder that this bound column is associated with.
Declaration
public virtual GridModelDataBinder Owner { get; set; }
Property Value
| Type |
|---|
| GridModelDataBinder |
Remarks
Each GridDataBoundGrid has a GridModelDataBinder. The GridModelDataBinder provides loading and saving data from an external data source and supports BeginEdit, EndEdit, and AddNew functionality.
Position
Gets or sets the position of the GridBoundColumn
Declaration
public int Position { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
PropertyDescriptor
Gets or sets the PropertyDescriptor that defines the data to be displayed in the column.
Declaration
public virtual PropertyDescriptor PropertyDescriptor { get; set; }
Property Value
| Type |
|---|
| System.ComponentModel.PropertyDescriptor |
ReadOnly
Gets or sets a value indicating whether Read-only state of the column.
Declaration
public virtual bool ReadOnly { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
StyleInfo
Gets or sets information how to format cells in the column.
Declaration
public GridStyleInfo StyleInfo { get; set; }
Property Value
| Type |
|---|
| GridStyleInfo |
Tag
Gets or sets a tag that is associated with this object.
Declaration
public object Tag { get; set; }
Property Value
| Type |
|---|
| System.Object |
Width
Gets or sets the width of the GridBoundColumn
Declaration
public int Width { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
Methods
Clone()
Returns a copy of this object.
Declaration
public object Clone()
Returns
| Type | Description |
|---|---|
| System.Object | A GridBoundColumn object. |
Dispose(Boolean)
Releases all resources used by the System.ComponentModel.Component.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
Remarks
See the documentation for the System.ComponentModel.Component class and its Dispose member.
ResetHeaderText()
Resets the header text.
Declaration
public void ResetHeaderText()
SetOwner(ICurrencyManagerSource)
Sets the ICurrencyManagerSource this bound column is associated with.
Declaration
public void SetOwner(ICurrencyManagerSource owner)
Parameters
| Type | Name | Description |
|---|---|---|
| ICurrencyManagerSource | owner | The ICurrencyManagerSource object. |
Events
HeaderTextChanged
Occurs when the HeaderText property has changed.
Declaration
public event EventHandler HeaderTextChanged
Event Type
| Type |
|---|
| System.EventHandler |
HiddenChanged
Occurs when the Hidden property has changed.
Declaration
public event EventHandler HiddenChanged
Event Type
| Type |
|---|
| System.EventHandler |
MappingNameChanged
Occurs when the MappingName property has changed.
Declaration
public event EventHandler MappingNameChanged
Event Type
| Type |
|---|
| System.EventHandler |
PositionChanged
Occurs when the Position property has changed.
Declaration
public event EventHandler PositionChanged
Event Type
| Type |
|---|
| System.EventHandler |
PropertyDescriptorChanged
Occurs when the PropertyDescriptor property has changed.
Declaration
public event EventHandler PropertyDescriptorChanged
Event Type
| Type |
|---|
| System.EventHandler |
ReadOnlyChanged
Occurs when the ReadOnly property has changed.
Declaration
public event EventHandler ReadOnlyChanged
Event Type
| Type |
|---|
| System.EventHandler |
WidthChanged
Occurs when the Width property has changed.
Declaration
public event EventHandler WidthChanged
Event Type
| Type |
|---|
| System.EventHandler |
Explicit Interface Implementations
ICurrencyManagerSource.GetCurrencyManager()
used to get System.Windows.Forms.CurrencyManager that is associated with the current object.
Declaration
CurrencyManager ICurrencyManagerSource.GetCurrencyManager()
Returns
| Type | Description |
|---|---|
| System.Windows.Forms.CurrencyManager | Returns the currencyManager associate with this object. |