ClassGridViewColumn
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 IComparable and INotifyPropertyChanged interfaces
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.GridView.dll
Syntax:
[TypeConverter(typeof(ExpandableObjectConverter))]
public abstract class GridViewColumn : RadObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IEditorProvider, INotifyPropertyChangingEx, IContextMenuProvider
Inheritance: objectDisposableObjectRadObjectGridViewColumn
Derived Classes:
Implements:
Inherited Members
Constructors
GridViewColumn()
Initializes a new instance of the GridViewColumn.
Declaration
public GridViewColumn()
GridViewColumn(string)
Initializes a new instance of the GridViewColumn.
Declaration
public GridViewColumn(string fieldName)
Parameters
fieldName
A string value referring to the unique name of the column.
GridViewColumn(string, string)
Initializes a new instance of the GridViewColumn.
Fields
AllowReorderProperty
Declaration
public static RadProperty AllowReorderProperty
Field Value
AutoEllipsisProperty
Declaration
public static RadProperty AutoEllipsisProperty
Field Value
AutoSizeModeProperty
Declaration
public static RadProperty AutoSizeModeProperty
Field Value
DisableHTMLRenderingProperty
Declaration
public static RadProperty DisableHTMLRenderingProperty
Field Value
EnableExpressionEditorProperty
Declaration
public static RadProperty EnableExpressionEditorProperty
Field Value
HeaderSvgImageProperty
Declaration
public static RadProperty HeaderSvgImageProperty
Field Value
HeaderTextAlignmentProperty
Declaration
public static RadProperty HeaderTextAlignmentProperty
Field Value
IsAutoGeneratedProperty
Declaration
public static RadProperty IsAutoGeneratedProperty
Field Value
StretchVerticallyProperty
Declaration
public static RadProperty StretchVerticallyProperty
Field Value
TextAlignmentProperty
Declaration
public static RadProperty TextAlignmentProperty
Field Value
TextImageRelationProperty
Declaration
public static RadProperty TextImageRelationProperty
Field Value
VisibleInColumnChooserProperty
Declaration
public static RadProperty VisibleInColumnChooserProperty
Field Value
Properties
AllowGroup
Gets or sets a value indicating whether the user can group data based on the content of this column.
Declaration
[Browsable(true)]
public virtual bool AllowGroup { get; set; }
Property Value
AllowHide
Gets or sets value indicating whether the user can hide the column.
Declaration
[Browsable(true)]
public virtual bool AllowHide { get; set; }
Property Value
AllowReorder
Gets or sets a value indicating whether the user can reorder this column using the mouse.
Declaration
[Browsable(true)]
public virtual bool AllowReorder { get; set; }
Property Value
AllowResize
Gets or sets value indicating whether the user can resize the column.
Declaration
[Browsable(true)]
public virtual bool AllowResize { get; set; }
Property Value
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
[Browsable(true)]
public virtual bool AllowSort { get; set; }
Property Value
AutoEllipsis
Gets or sets the auto ellipsis.
Declaration
[Browsable(true)]
public bool AutoEllipsis { get; set; }
Property Value
The auto ellipsis.
AutoSizeMode
Gets or sets the mode by which the column automatically adjusts its width after BestFit is executed.
Declaration
[Browsable(false)]
public BestFitColumnMode AutoSizeMode { get; set; }
Property Value
ConditionalFormattingObjectList
Gets list of BaseFormattingObject instances that define the currently applied conditional formatting of the data in the column.
Declaration
[Browsable(true)]
public virtual ConditionalFormattingObjectCollection ConditionalFormattingObjectList { get; }
Property Value
ContextMenu
Gets or sets the context menu assigned to the column.
Declaration
public RadDropDownMenu ContextMenu { get; set; }
Property Value
Implements
DisableHTMLRendering
Disable or Enable HTML-like text rendering in the column.
Declaration
[Browsable(true)]
public bool DisableHTMLRendering { get; set; }
Property Value
DpiScale
Gets or sets the DPI scale.
EnableExpressionEditor
Gets or sets the value indicating if expression editor menu item will be available to the user.
Declaration
[Browsable(true)]
public bool EnableExpressionEditor { get; set; }
Property Value
EventDispatcher
Gets the event dispatcher.
Declaration
protected EventDispatcher EventDispatcher { get; }
Property Value
The event dispatcher.
Expression
Gets or sets the expression used to calculate the values of this column.
Declaration
[Browsable(true)]
public string Expression { get; set; }
Property Value
FieldName
Gets or sets the name data source property or database column to which the GridViewDataColumn is bound.
Declaration
[Browsable(true)]
public string FieldName { get; set; }
Property Value
HeaderImage
Gets or set the ColumnInfo Header image.
Declaration
[Browsable(true)]
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image HeaderImage { get; set; }
Property Value
HeaderSvgImage
Gets or set the ColumnInfo Header vector image.
Declaration
[Browsable(true)]
[TypeConverter(typeof(SvgImageTypeConverter))]
public virtual RadSvgImage HeaderSvgImage { get; set; }
Property Value
HeaderText
Gets or sets the caption text on the column's header cell.
Declaration
[Browsable(true)]
public virtual string HeaderText { get; set; }
Property Value
HeaderTextAlignment
Gets or sets a value indicating the position of the HeaderText within the header cell.
Declaration
[Browsable(true)]
public ContentAlignment HeaderTextAlignment { get; set; }
Property Value
ImageLayout
Gets or sets the image layout of the image inside the cells.
Declaration
[Browsable(true)]
public virtual ImageLayout ImageLayout { get; set; }
Property Value
Index
Gets a value indicating the position of the column in the Columns collection of the OwnerTemplate.
IsCurrent
Gets value indicating whether the column contains the currently selected cell in the OwnerTemplate.
Declaration
[Browsable(false)]
public bool IsCurrent { get; set; }
Property Value
IsDataBound
Gets a value indicating whether the column is bound to the data field referred by FieldName.
Declaration
[Browsable(false)]
public virtual bool IsDataBound { get; }
Property Value
IsFieldNamePath
Gets whether is field name path.
Declaration
[Browsable(false)]
public bool IsFieldNamePath { get; }
Property Value
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
[Browsable(false)]
public virtual bool IsGrouped { get; }
Property Value
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
[Browsable(true)]
public bool IsPinned { get; set; }
Property Value
IsSorted
Gets a boolean value indicating whether a sort order of data in the column is currently applied.
Declaration
[Browsable(false)]
public virtual bool IsSorted { get; }
Property Value
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
[Browsable(true)]
public virtual bool IsVisible { get; set; }
Property Value
MaxWidth
Gets or sets the maximal width, in pixels, of the column.
Declaration
[Browsable(true)]
public int MaxWidth { get; set; }
Property Value
MinWidth
Gets or sets the minimum width, in pixels, of the column.
Declaration
[Browsable(true)]
public int MinWidth { get; set; }
Property Value
Name
Gets or sets a string value representing the column's unique name in the Columns collection of the OwnerTemplate.
Declaration
[Browsable(true)]
public virtual string Name { get; set; }
Property Value
OwnerTemplate
Gets the instance of GridViewTemplate which the column belongs to.
Declaration
[Browsable(false)]
public GridViewTemplate OwnerTemplate { get; }
Property Value
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
ReadOnly
Gets or sets a value indicating whether the user can edit the data in the column's cells.
Declaration
[Browsable(true)]
public virtual bool ReadOnly { get; set; }
Property Value
RowSpan
Gets or sets the vertical span of the cells in that column (the height) in pixels. Relevant only in ColumnGroupsViewDefinition.
SortOrder
Gets or sets a value indicating the sort order of data in the column.
Declaration
[Browsable(true)]
public RadSortOrder SortOrder { get; set; }
Property Value
StretchVertically
Gets or sets a value indicating whether to stretch the column height vertically. Used with ColumnGroupsViewDefinition.
Declaration
[Browsable(true)]
public bool StretchVertically { get; set; }
Property Value
Tag
Gets or sets the object that contains data about the column.
Declaration
[Browsable(false)]
public object Tag { get; set; }
Property Value
TextAlignment
Gets or sets a value indicating the position of the cell content within a column's cells.
Declaration
[Browsable(true)]
public virtual ContentAlignment TextAlignment { get; set; }
Property Value
TextImageRelation
Gets or sets a value indicating the TextImageRelation: ImageAboveText, ImageBeforeText, Overlay, TextAboveImage, and TextBeforeImage.
Declaration
[Browsable(true)]
public TextImageRelation TextImageRelation { get; set; }
Property Value
VisibleInColumnChooser
Gets or sets a value indicating whether the column will be visible in ColumnChooserElement.
Declaration
[Browsable(true)]
public virtual bool VisibleInColumnChooser { get; set; }
Property Value
Remarks
Use this property if you want to hide columns from the user.
Width
Gets or sets the width of the column.
Declaration
[Browsable(true)]
public virtual int Width { get; set; }
Property Value
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.
CanDragToGroup(GridViewTemplate)
Determines whether this column may be dragged onto the GroupBy panel.
Declaration
public bool CanDragToGroup(GridViewTemplate template)
Parameters
template
Returns
CreateConditionalFormattingForm()
Creates the conditional formatting form.
Declaration
protected virtual ConditionalFormattingForm CreateConditionalFormattingForm()
Returns
CreateContextMenuItems(RadDropDownMenu)
Declaration
protected virtual void CreateContextMenuItems(RadDropDownMenu menu)
Parameters
menu
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
id
The id.
type
The type.
dispatchMode
The dispatch mode.
originator
The originator.
arguments
object[]
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
row
The specified row.
Returns
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
An object that implements IInputEditor interface.
Implements
GetDefaultEditorType()
Gets the default editor type for the editor provider.
Declaration
public virtual Type GetDefaultEditorType()
Returns
The default type.
Implements
GetDefaultGroupByExpression()
Retrieves the default group-by expression string for the column.
Declaration
public virtual string GetDefaultGroupByExpression()
Returns
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.
GetEventInfo(RadProperty, out GridEventDispatchMode)
Gets the event info.
Declaration
protected virtual GridEventType GetEventInfo(RadProperty property, out GridEventDispatchMode dispatchMode)
Parameters
property
The property.
dispatchMode
The dispatch mode.
Returns
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
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
metadata
The metadata associated with the property change.
Returns
Overrides
MergeMenus(IContextMenuManager, params object[])
Merges the context menu.
Declaration
public RadDropDownMenu MergeMenus(IContextMenuManager contextMenuManager, params object[] parameters)
Parameters
contextMenuManager
The IContextMenuManager to merge with.
parameters
object[]
merge parameters.
Returns
The merged context menu, if successful.
Implements
MergeMenus(IContextMenuProvider, params object[])
Merges the context menu.
Declaration
public RadDropDownMenu MergeMenus(IContextMenuProvider contextMenuProvider, params object[] parameters)
Parameters
contextMenuProvider
The IContextMenuProvider to merge with.
parameters
object[]
merge parameters.
Returns
The merged context menu, if successful.
Implements
MergeMenus(RadDropDownMenu, params object[])
Merges the context menu.
Declaration
public RadDropDownMenu MergeMenus(RadDropDownMenu contextMenu, params object[] parameters)
Parameters
contextMenu
The RadDropDownMenu to merge with.
parameters
object[]
merge parameters.
Returns
The merged context menu, if successful.
Implements
OnNotifyPropertyChanging(PropertyChangingEventArgsEx)
Declaration
protected virtual void OnNotifyPropertyChanging(PropertyChangingEventArgsEx e)
Parameters
e
OnNotifyPropertyChanging(string)
Declaration
protected void OnNotifyPropertyChanging(string propertyName)
Parameters
propertyName
OnPropertyChanged(RadPropertyChangedEventArgs)
Raises the RadPropertyChanged event and the standard .NET PropertyChanged event to notify subscribers of property value changes.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
The RadPropertyChangedEventArgs containing information about the property change.
Overrides
OnPropertyChanging(RadPropertyChangingEventArgs)
Raises the RadPropertyChanging event, allowing subscribers to be notified before a property value changes and potentially cancel the change.
Declaration
protected override void OnPropertyChanging(RadPropertyChangingEventArgs e)
Parameters
e
Overrides
ShowContextMenu()
Shows the context menu.
Declaration
public virtual void ShowContextMenu()
Sort(RadSortOrder)
Sorts with the specified sort order.
Declaration
public virtual void Sort(RadSortOrder sortOrder)
Parameters
sortOrder
The sort order.
Sort(RadSortOrder, bool)
Sorts the specified sort order.
Declaration
public bool Sort(RadSortOrder sortOrder, bool multiSortMode)
Parameters
sortOrder
The sort order.
multiSortMode
if set to true [multi sort mode].
Returns
ToString()
Returns a string representation of the column.
Declaration
public override string ToString()
Returns
The string representation for the column.
Overrides
ToggleSortOrder()
Toggles the column sort order.
Declaration
protected void ToggleSortOrder()
Events
PropertyChanging
Occurs when a property value is changing.
Declaration
public event PropertyChangingEventHandlerEx PropertyChanging
Event Value
Implements