Class GridViewColumn
Abstract class, representing the base for all types of columns in RadGridView A special inheritor is the GridViewDataColumn which is base for all data-bound columns.
Implements System.IComparable and System.ComponentModel.INotifyPropertyChanged interfaces
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.GridView.dll
Syntax
public abstract class GridViewColumn : RadObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IEditorProvider, INotifyPropertyChangingEx
Constructors
GridViewColumn()
GridViewColumn(String)
Initializes a new instance of the GridViewColumn.
Declaration
public GridViewColumn(string fieldName)
Parameters
System.String
fieldName
A string value referring to the unique name of the column. |
GridViewColumn(String, String)
Initializes a new instance of the GridViewColumn.
Declaration
public GridViewColumn(string name, string fieldName)
Parameters
System.String
name
A string value referring to the unique name of the column. |
System.String
fieldName
A string value referring to the field name to which the column is bound. |
Fields
AllowGroupProperty
AllowHideProperty
AllowReorderProperty
AllowResizeProperty
AllowSortProperty
AutoEllipsisProperty
AutoSizeModeProperty
DisableHTMLRenderingProperty
EnableExpressionEditorProperty
ExpressionProperty
FieldNameProperty
HeaderImageProperty
HeaderSvgImageProperty
HeaderTextAlignmentProperty
HeaderTextProperty
ImageLayoutProperty
IsAutoGeneratedProperty
IsCurrentProperty
IsVisibleProperty
MaxWidthProperty
MinWidthProperty
NameProperty
PinPositionProperty
ReadOnlyProperty
RenderWidthProperty
RowSpanProperty
ShowEditorProperty
StretchVerticallyProperty
TagProperty
TextAlignmentProperty
TextImageRelationProperty
VisibleInColumnChooserProperty
WidthProperty
WrapTextProperty
Properties
AllowGroup
Gets or sets a value indicating whether the user can group data based on the content of this column.
Declaration
public virtual bool AllowGroup { get; set; }
Property Value
System.Boolean
|
See Also
AllowHide
Gets or sets value indicating whether the user can hide the column.
Declaration
public virtual bool AllowHide { get; set; }
Property Value
System.Boolean
|
AllowReorder
Gets or sets a value indicating whether the user can reorder this column using the mouse.
Declaration
public virtual bool AllowReorder { get; set; }
Property Value
System.Boolean
|
AllowResize
Gets or sets value indicating whether the user can resize the column.
Declaration
public virtual bool AllowResize { get; set; }
Property Value
System.Boolean
|
AllowSort
Gets or sets a value indicating whether the user can sort the data in the OwnerTemplate based on the contents of this column.
Declaration
public virtual bool AllowSort { get; set; }
Property Value
System.Boolean
|
AutoEllipsis
Gets or sets the auto ellipsis.
Declaration
public bool AutoEllipsis { get; set; }
Property Value
System.Boolean
The auto ellipsis. |
AutoSizeMode
Gets or sets the mode by which the column automatically adjusts its width after BestFit is executed.
Declaration
public BestFitColumnMode AutoSizeMode { get; set; }
Property Value
BestFitColumnMode
|
ConditionalFormattingObjectList
Gets list of BaseFormattingObject instances that define the currently applied conditional formatting of the data in the column.
Declaration
public virtual ConditionalFormattingObjectCollection ConditionalFormattingObjectList { get; }
Property Value
ConditionalFormattingObjectCollection
|
DisableHTMLRendering
Disable or Enable HTML-like text rendering in the column.
Declaration
public bool DisableHTMLRendering { get; set; }
Property Value
System.Boolean
|
DpiScale
Gets or sets the DPI scale.
Declaration
public SizeF DpiScale { get; }
Property Value
System.Drawing.SizeF
The dpi scale. |
EnableExpressionEditor
Gets or sets the value indicating if expression editor menu item will be available to the user.
Declaration
public bool EnableExpressionEditor { get; set; }
Property Value
System.Boolean
|
EventDispatcher
Gets the event dispatcher.
Declaration
protected EventDispatcher EventDispatcher { get; }
Property Value
EventDispatcher
The event dispatcher. |
Expression
Gets or sets the expression used to calculate the values of this column.
Declaration
public string Expression { get; set; }
Property Value
System.String
|
FieldName
Gets or sets the name data source property or database column to which the GridViewDataColumn is bound.
Declaration
public string FieldName { get; set; }
Property Value
System.String
|
HeaderImage
Gets or set the ColumnInfo Header image.
Declaration
public virtual Image HeaderImage { get; set; }
Property Value
System.Drawing.Image
|
HeaderSvgImage
Gets or set the ColumnInfo Header vector image.
Declaration
public virtual RadSvgImage HeaderSvgImage { get; set; }
Property Value
RadSvgImage
|
HeaderText
Gets or sets the caption text on the column's header cell.
Declaration
public virtual string HeaderText { get; set; }
Property Value
System.String
|
HeaderTextAlignment
Gets or sets a value indicating the position of the HeaderText within the header cell.
Declaration
public ContentAlignment HeaderTextAlignment { get; set; }
Property Value
System.Drawing.ContentAlignment
|
ImageLayout
Gets or sets the image layout of the image inside the cells.
Declaration
public virtual ImageLayout ImageLayout { get; set; }
Property Value
System.Windows.Forms.ImageLayout
|
Index
Gets a value indicating the position of the column in the Columns collection of the OwnerTemplate.
Declaration
public int Index { get; }
Property Value
System.Int32
|
IsAutoGenerated
Gets value indicating whether the current column is automatically created when the RadGridView is being bound to a data source.
Declaration
public bool IsAutoGenerated { get; set; }
Property Value
System.Boolean
|
IsCurrent
Gets value indicating whether the column contains the currently selected cell in the OwnerTemplate.
Declaration
public bool IsCurrent { get; set; }
Property Value
System.Boolean
|
IsDataBound
Gets a value indicating whether the column is bound to the data field referred by FieldName.
Declaration
public virtual bool IsDataBound { get; }
Property Value
System.Boolean
|
IsFieldNamePath
Gets whether is field name path.
Declaration
public bool IsFieldNamePath { get; }
Property Value
System.Boolean
The is field name path. |
IsGrouped
Gets a value indicating whether the data in the OwnerTemplate is grouped based on the content of this column.
Declaration
public virtual bool IsGrouped { get; }
Property Value
System.Boolean
|
See Also
IsPinned
Gets or sets value indicating whether the current column is pinned and cannot be moved from its location when a user scrolls horizontally.
Declaration
public bool IsPinned { get; set; }
Property Value
System.Boolean
|
IsSorted
Gets a boolean value indicating whether a sort order of data in the column is currently applied.
Declaration
public virtual bool IsSorted { get; }
Property Value
System.Boolean
|
Remarks
When multi-column sorting is applied, the column might be partially sorted.
IsVisible
Gets or sets a value indicating whether the column is visible.
Declaration
public virtual bool IsVisible { get; set; }
Property Value
System.Boolean
|
MaxWidth
Gets or sets the maximal width, in pixels, of the column.
Declaration
public int MaxWidth { get; set; }
Property Value
System.Int32
|
MinWidth
Gets or sets the minimum width, in pixels, of the column.
Declaration
public int MinWidth { get; set; }
Property Value
System.Int32
|
Name
Gets or sets a string value representing the column's unique name in the Columns collection of the OwnerTemplate.
Declaration
public virtual string Name { get; set; }
Property Value
System.String
|
OwnerTemplate
Gets the instance of GridViewTemplate which the column belongs to.
Declaration
public GridViewTemplate OwnerTemplate { get; }
Property Value
GridViewTemplate
|
PinPosition
Gets or sets the pin position for the row. When the column is pinned, it cannot be moved from its location when a user scrolls horizontally.
Declaration
public PinnedColumnPosition PinPosition { get; set; }
Property Value
PinnedColumnPosition
|
ReadOnly
Gets or sets a value indicating whether the user can edit the data in the column's cells.
Declaration
public virtual bool ReadOnly { get; set; }
Property Value
System.Boolean
|
RowSpan
Gets or sets the vertical span of the cells in that column (the height) in pixels. Relevant only in ColumnGroupsViewDefinition.
Declaration
public int RowSpan { get; set; }
Property Value
System.Int32
|
SortOrder
Gets or sets a value indicating the sort order of data in the column.
Declaration
public RadSortOrder SortOrder { get; set; }
Property Value
RadSortOrder
|
StretchVertically
Gets or sets a value indicating whether to stretch the column height vertically. Used with ColumnGroupsViewDefinition.
Declaration
public bool StretchVertically { get; set; }
Property Value
System.Boolean
|
Tag
Gets or sets the object that contains data about the column.
Declaration
public object Tag { get; set; }
Property Value
System.Object
|
TextAlignment
Gets or sets a value indicating the position of the cell content within a column's cells.
Declaration
public virtual ContentAlignment TextAlignment { get; set; }
Property Value
System.Drawing.ContentAlignment
|
TextImageRelation
Gets or sets a value indicating the TextImageRelation: ImageAboveText, ImageBeforeText, Overlay, TextAboveImage, and TextBeforeImage.
Declaration
public TextImageRelation TextImageRelation { get; set; }
Property Value
System.Windows.Forms.TextImageRelation
|
VisibleInColumnChooser
Gets or sets a value indicating whether the column will be visible in ColumnChooserElement.
Declaration
public virtual bool VisibleInColumnChooser { get; set; }
Property Value
System.Boolean
|
Remarks
Use this property if you want to hide columns from the user.
Width
Gets or sets the width of the column.
Declaration
public virtual int Width { get; set; }
Property Value
System.Int32
|
WrapText
Gets or sets value indicating whether the text in each cell in the column should be wrapped.
Declaration
public bool WrapText { get; set; }
Property Value
System.Boolean
|
Methods
BestFit()
Adjusts the column width to fit the contents of all cells in the column, including the header cell.
Declaration
public void BestFit()
CanDragToGroup()
Determines whether this column may be dragged onto the GroupBy panel.
Declaration
public bool CanDragToGroup()
Returns
System.Boolean
|
CanDragToGroup(GridViewTemplate)
Determines whether this column may be dragged onto the GroupBy panel.
Declaration
public bool CanDragToGroup(GridViewTemplate template)
Parameters
GridViewTemplate
template
|
Returns
System.Boolean
|
DispatchEvent(KnownEvents, GridEventType, GridEventDispatchMode, Object, Object[])
Dispatches the event.
Declaration
protected virtual void DispatchEvent(KnownEvents id, GridEventType type, GridEventDispatchMode dispatchMode, object originator, object[] arguments)
Parameters
KnownEvents
id
The id. |
GridEventType
type
The type. |
GridEventDispatchMode
dispatchMode
The dispatch mode. |
System.Object
originator
The originator. |
System.Object[]
arguments
The arguments. |
GetCellType(GridViewRowInfo)
Returns the type of cell element to be created for the specified row.
Declaration
public virtual Type GetCellType(GridViewRowInfo row)
Parameters
GridViewRowInfo
row
The specified row. |
Returns
System.Type
The type of the cell to be created. |
GetDefaultEditor()
Returns an editor instance of the default type for the editor provider.
Declaration
public virtual IInputEditor GetDefaultEditor()
Returns
IInputEditor
An object that implements IInputEditor interface. |
Implements
GetDefaultEditorType()
Gets the default editor type for the editor provider.
Declaration
public virtual Type GetDefaultEditorType()
Returns
System.Type
The default type. |
Implements
GetDefaultGroupByExpression()
Retrieves the default group-by expression string for the column.
Declaration
public virtual string GetDefaultGroupByExpression()
Returns
System.String
The string value representing a group-by expression with default settings. |
GetDefaultMinWidth()
Gets a value indicating default minimum width for the inherited column type. If not overridden in inheritor class it defaults to 5.
Declaration
protected virtual int GetDefaultMinWidth()
Returns
System.Int32
|
GetEventInfo(RadProperty, out GridEventDispatchMode)
Gets the event info.
Declaration
protected virtual GridEventType GetEventInfo(RadProperty property, out GridEventDispatchMode dispatchMode)
Parameters
RadProperty
property
The property. |
GridEventDispatchMode
dispatchMode
The dispatch mode. |
Returns
GridEventType
|
Initialize()
Initializes the column.
Declaration
protected virtual void Initialize()
Remarks
This method is called when the column is associated with GridViewTemplate.
InitializeEditor(IInputEditor)
Initializes a specified editor.
Declaration
public virtual void InitializeEditor(IInputEditor editor)
Parameters
IInputEditor
editor
An object that implements IInputEditor interface. |
Implements
IsPropertyCancelable(RadPropertyMetadata)
Determines whether the specified property may be canceled.
Declaration
protected override bool IsPropertyCancelable(RadPropertyMetadata metadata)
Parameters
RadPropertyMetadata
metadata
The metadata associated with the property change. |
Returns
System.Boolean
|
Overrides
OnNotifyPropertyChanging(String)
Declaration
protected void OnNotifyPropertyChanging(string propertyName)
Parameters
System.String
propertyName
|
OnNotifyPropertyChanging(PropertyChangingEventArgsEx)
Declaration
protected virtual void OnNotifyPropertyChanging(PropertyChangingEventArgsEx e)
Parameters
PropertyChangingEventArgsEx
e
|
OnPropertyChanged(RadPropertyChangedEventArgs)
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
RadPropertyChangedEventArgs
e
|
Overrides
OnPropertyChanging(RadPropertyChangingEventArgs)
Declaration
protected override void OnPropertyChanging(RadPropertyChangingEventArgs e)
Parameters
RadPropertyChangingEventArgs
e
|
Overrides
Sort(RadSortOrder, Boolean)
Sorts the specified sort order.
Declaration
public bool Sort(RadSortOrder sortOrder, bool multiSortMode)
Parameters
RadSortOrder
sortOrder
The sort order. |
System.Boolean
multiSortMode
if set to |
Returns
System.Boolean
|
ToString()
Returns a string representation of the column.
Declaration
public override string ToString()
Returns
System.String
The string representation for the column. |
Overrides
Events
PropertyChanging
Declaration
public event PropertyChangingEventHandlerEx PropertyChanging
Event Type
PropertyChangingEventHandlerEx
|