New to Telerik UI for WinFormsStart a free 30-day trial

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:

C#
[TypeConverter(typeof(ExpandableObjectConverter))]
public abstract class GridViewColumn : RadObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, IEditorProvider, INotifyPropertyChangingEx, IContextMenuProvider

Inheritance: objectDisposableObjectRadObjectGridViewColumn

Derived Classes: GridViewDataColumnGridViewGroupColumnGridViewIndentColumnGridViewRowHeaderColumnGridViewSelectColumn

Implements: IContextMenuProviderICustomTypeDescriptorIDisposableIEditorProviderINotifyPropertyChangedINotifyPropertyChangingEx...

Inherited Members RadObject.BindingContextPropertyRadObject.RadTypeRadObject.ReplaceDefaultDescriptors(PropertyDescriptorCollection)RadObject.DisposeManagedResources()RadObject.ClearPropertyStore()RadObject.SuspendPropertyNotifications()RadObject.ResumePropertyNotifications()RadObject.GetPropertyValue(RadProperty)RadObject.SetDefaultValueOverride(RadProperty, object)RadObject.GetValue(RadProperty)RadObject.SetValue(RadProperty, object)RadObject.ResetValue(RadProperty)RadObject.ResetLocalValue(RadProperty)RadObject.ResetValue(RadProperty, ValueResetFlags)RadObject.UpdateValue(RadProperty)RadObject.GetValueSource(RadProperty)RadObject.GetRegisteredRadProperty(string)RadObject.UpdateValueCore(RadPropertyValue)RadObject.SetValueCore(RadPropertyValue, object, object, ValueSource)RadObject.ResetValueCore(RadPropertyValue, ValueResetFlags)RadObject.GetDefaultValue(RadPropertyValue, object)RadObject.CoerceValue(RadPropertyValue, object)RadObject.ShouldSerializeProperty(RadProperty)RadObject.CanRaisePropertyChangeNotifications(RadPropertyValue)RadObject.BindProperty(RadProperty, RadObject, RadProperty, PropertyBindingOptions)RadObject.UnbindProperty(RadProperty)RadObject.AddStylePropertySetting(IPropertySetting)RadObject.GetInheritedValue(RadProperty)RadObject.OnNotifyPropertyChanged(string)RadObject.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadObject.OnShouldSerializeProperty(ShouldSerializePropertyEventArgs)RadObject.PropertyValuesRadObject.PropertyFilterRadObject.RadObjectTypeRadObject.BindingContextRadObject.PropertyChangedRadObject.RadPropertyChangedRadObject.RadPropertyChangingDisposableObject.GetBitState(long)DisposableObject.SetBitState(long, bool)DisposableObject.OnBitStateChanged(long, bool, bool)DisposableObject.Dispose()DisposableObject.Dispose(bool)DisposableObject.PerformDispose(bool)DisposableObject.DisposeUnmanagedResources()DisposableObject.BitStateDisposableObject.EventsDisposableObject.IsDisposingDisposableObject.IsDisposedDisposableObject.DisposedDisposableObject.Disposing...

Constructors

Initializes a new instance of the GridViewColumn.

C#
public GridViewColumn()

Initializes a new instance of the GridViewColumn.

C#
public GridViewColumn(string name, string fieldName)
Parameters:namestring

A string value referring to the unique name of the column.

fieldNamestring

A string value referring to the field name to which the column is bound.

Initializes a new instance of the GridViewColumn.

C#
public GridViewColumn(string fieldName)
Parameters:fieldNamestring

A string value referring to the unique name of the column.

Fields

C#
public static RadProperty AllowGroupProperty
C#
public static RadProperty AllowHideProperty
C#
public static RadProperty AllowReorderProperty
C#
public static RadProperty AllowResizeProperty
C#
public static RadProperty AllowSortProperty
C#
public static RadProperty AutoEllipsisProperty
C#
public static RadProperty AutoSizeModeProperty
C#
public static RadProperty DisableHTMLRenderingProperty
C#
public static RadProperty EnableExpressionEditorProperty
C#
public static RadProperty ExpressionProperty
C#
public static RadProperty FieldNameProperty
C#
public static RadProperty HeaderImageProperty
C#
public static RadProperty HeaderSvgImageProperty
C#
public static RadProperty HeaderTextAlignmentProperty
C#
public static RadProperty HeaderTextProperty
C#
public static RadProperty ImageLayoutProperty
C#
public static RadProperty IsAutoGeneratedProperty
C#
public static RadProperty IsCurrentProperty
C#
public static RadProperty IsVisibleProperty
C#
public static RadProperty MaxWidthProperty
C#
public static RadProperty MinWidthProperty
C#
public static RadProperty NameProperty
C#
public static RadProperty PinPositionProperty
C#
public static RadProperty ReadOnlyProperty
C#
public static RadProperty RenderWidthProperty
C#
public static RadProperty RowSpanProperty
C#
public static RadProperty ShowEditorProperty
C#
public static RadProperty StretchVerticallyProperty
C#
public static RadProperty TagProperty
C#
public static RadProperty TextAlignmentProperty
C#
public static RadProperty TextImageRelationProperty
C#
public static RadProperty VisibleInColumnChooserProperty
C#
public static RadProperty WidthProperty
C#
public static RadProperty WrapTextProperty

Properties

Gets or sets a value indicating whether the user can group data based on the content of this column.

C#
[Browsable(true)]
public virtual bool AllowGroup { get; set; }

Gets or sets value indicating whether the user can hide the column.

C#
[Browsable(true)]
public virtual bool AllowHide { get; set; }

Gets or sets a value indicating whether the user can reorder this column using the mouse.

C#
[Browsable(true)]
public virtual bool AllowReorder { get; set; }

Gets or sets value indicating whether the user can resize the column.

C#
[Browsable(true)]
public virtual bool AllowResize { get; set; }

Gets or sets a value indicating whether the user can sort the data in the OwnerTemplate based on the contents of this column.

C#
[Browsable(true)]
public virtual bool AllowSort { get; set; }

Gets or sets the auto ellipsis.

C#
[Browsable(true)]
public bool AutoEllipsis { get; set; }
Property Value:

The auto ellipsis.

Gets or sets the mode by which the column automatically adjusts its width after BestFit is executed.

C#
[Browsable(false)]
public BestFitColumnMode AutoSizeMode { get; set; }

Gets list of BaseFormattingObject instances that define the currently applied conditional formatting of the data in the column.

C#
[Browsable(true)]
public virtual ConditionalFormattingObjectCollection ConditionalFormattingObjectList { get; }

Gets or sets the context menu assigned to the column.

C#
public RadDropDownMenu ContextMenu { get; set; }

Implements: IContextMenuProvider.ContextMenu

Disable or Enable HTML-like text rendering in the column.

C#
[Browsable(true)]
public bool DisableHTMLRendering { get; set; }

Gets or sets the DPI scale.

C#
public SizeF DpiScale { get; }
Property Value:

The dpi scale.

Gets or sets the value indicating if expression editor menu item will be available to the user.

C#
[Browsable(true)]
public bool EnableExpressionEditor { get; set; }

Gets the event dispatcher.

C#
protected EventDispatcher EventDispatcher { get; }
Property Value:

The event dispatcher.

Gets or sets the expression used to calculate the values of this column.

C#
[Browsable(true)]
public string Expression { get; set; }

Gets or sets the name data source property or database column to which the GridViewDataColumn is bound.

C#
[Browsable(true)]
public string FieldName { get; set; }

Gets or set the ColumnInfo Header image.

C#
[Browsable(true)]
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image HeaderImage { get; set; }

Gets or set the ColumnInfo Header vector image.

C#
[Browsable(true)]
[TypeConverter(typeof(SvgImageTypeConverter))]
public virtual RadSvgImage HeaderSvgImage { get; set; }

Gets or sets the caption text on the column's header cell.

C#
[Browsable(true)]
public virtual string HeaderText { get; set; }

Gets or sets a value indicating the position of the HeaderText within the header cell.

C#
[Browsable(true)]
public ContentAlignment HeaderTextAlignment { get; set; }

Gets or sets the image layout of the image inside the cells.

C#
[Browsable(true)]
public virtual ImageLayout ImageLayout { get; set; }

Gets a value indicating the position of the column in the Columns collection of the OwnerTemplate.

C#
[Browsable(false)]
public int Index { get; }

Gets value indicating whether the column contains the currently selected cell in the OwnerTemplate.

C#
[Browsable(false)]
public bool IsCurrent { get; set; }

Gets a value indicating whether the column is bound to the data field referred by FieldName.

C#
[Browsable(false)]
public virtual bool IsDataBound { get; }

Gets whether is field name path.

C#
[Browsable(false)]
public bool IsFieldNamePath { get; }
Property Value:

The is field name path.

Gets a value indicating whether the data in the OwnerTemplate is grouped based on the content of this column.

C#
[Browsable(false)]
public virtual bool IsGrouped { get; }

Gets or sets value indicating whether the current column is pinned and cannot be moved from its location when a user scrolls horizontally.

C#
[Browsable(true)]
public bool IsPinned { get; set; }

Gets a boolean value indicating whether a sort order of data in the column is currently applied.

C#
[Browsable(false)]
public virtual bool IsSorted { get; }
Remarks:

When multi-column sorting is applied, the column might be partially sorted.

Gets or sets a value indicating whether the column is visible.

C#
[Browsable(true)]
public virtual bool IsVisible { get; set; }

Gets or sets the maximal width, in pixels, of the column.

C#
[Browsable(true)]
public int MaxWidth { get; set; }

Gets or sets the minimum width, in pixels, of the column.

C#
[Browsable(true)]
public int MinWidth { get; set; }

Gets or sets a string value representing the column's unique name in the Columns collection of the OwnerTemplate.

C#
[Browsable(true)]
public virtual string Name { get; set; }

Gets the instance of GridViewTemplate which the column belongs to.

C#
[Browsable(false)]
public GridViewTemplate OwnerTemplate { get; }

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.

C#
public PinnedColumnPosition PinPosition { get; set; }

Gets or sets a value indicating whether the user can edit the data in the column's cells.

C#
[Browsable(true)]
public virtual bool ReadOnly { get; set; }

Gets or sets the vertical span of the cells in that column (the height) in pixels. Relevant only in ColumnGroupsViewDefinition.

C#
[Browsable(true)]
public int RowSpan { get; set; }

Gets or sets a value indicating the sort order of data in the column.

C#
[Browsable(true)]
public RadSortOrder SortOrder { get; set; }

Gets or sets a value indicating whether to stretch the column height vertically. Used with ColumnGroupsViewDefinition.

C#
[Browsable(true)]
public bool StretchVertically { get; set; }

Gets or sets the object that contains data about the column.

C#
[Browsable(false)]
public object Tag { get; set; }

Gets or sets a value indicating the position of the cell content within a column's cells.

C#
[Browsable(true)]
public virtual ContentAlignment TextAlignment { get; set; }

Gets or sets a value indicating the TextImageRelation: ImageAboveText, ImageBeforeText, Overlay, TextAboveImage, and TextBeforeImage.

C#
[Browsable(true)]
public TextImageRelation TextImageRelation { get; set; }

Gets or sets a value indicating whether the column will be visible in ColumnChooserElement.

C#
[Browsable(true)]
public virtual bool VisibleInColumnChooser { get; set; }
Remarks:

Use this property if you want to hide columns from the user.

Gets or sets the width of the column.

C#
[Browsable(true)]
public virtual int Width { get; set; }

Gets or sets value indicating whether the text in each cell in the column should be wrapped.

C#
[Browsable(true)]
public bool WrapText { get; set; }

Methods

Adjusts the column width to fit the contents of all cells in the column, including the header cell.

C#
public void BestFit()

Determines whether this column may be dragged onto the GroupBy panel.

C#
public bool CanDragToGroup()
Returns:

bool

Determines whether this column may be dragged onto the GroupBy panel.

C#
public bool CanDragToGroup(GridViewTemplate template)
Parameters:templateGridViewTemplateReturns:

bool

Creates the conditional formatting form.

C#
protected virtual ConditionalFormattingForm CreateConditionalFormattingForm()
Returns:

ConditionalFormattingForm

C#
protected virtual void CreateContextMenuItems(RadDropDownMenu menu)
Parameters:menuRadDropDownMenu

Dispatches the event.

C#
protected virtual void DispatchEvent(KnownEvents id, GridEventType type, GridEventDispatchMode dispatchMode, object originator, object[] arguments)
Parameters:idKnownEvents

The id.

typeGridEventType

The type.

dispatchModeGridEventDispatchMode

The dispatch mode.

originatorobject

The originator.

argumentsobject[]

The arguments.

Returns the type of cell element to be created for the specified row.

C#
public virtual Type GetCellType(GridViewRowInfo row)
Parameters:rowGridViewRowInfo

The specified row.

Returns:

Type

The type of the cell to be created.

Returns an editor instance of the default type for the editor provider.

C#
public virtual IInputEditor GetDefaultEditor()
Returns:

IInputEditor

An object that implements IInputEditor interface.

Implements: IEditorProvider.GetDefaultEditor()

Gets the default editor type for the editor provider.

C#
public virtual Type GetDefaultEditorType()
Returns:

Type

The default type.

Implements: IEditorProvider.GetDefaultEditorType()

Retrieves the default group-by expression string for the column.

C#
public virtual string GetDefaultGroupByExpression()
Returns:

string

The string value representing a group-by expression with default settings.

Gets a value indicating default minimum width for the inherited column type. If not overridden in inheritor class it defaults to 5.

C#
protected virtual int GetDefaultMinWidth()
Returns:

int

Gets the event info.

C#
protected virtual GridEventType GetEventInfo(RadProperty property, out GridEventDispatchMode dispatchMode)
Parameters:propertyRadProperty

The property.

dispatchModeGridEventDispatchMode

The dispatch mode.

Returns:

GridEventType

Initializes the column.

C#
protected virtual void Initialize()
Remarks:

This method is called when the column is associated with GridViewTemplate.

Initializes a specified editor.

C#
public virtual void InitializeEditor(IInputEditor editor)
Parameters:editorIInputEditor

An object that implements IInputEditor interface.

Implements: IEditorProvider.InitializeEditor(IInputEditor)

Determines whether the specified property may be canceled.

C#
protected override bool IsPropertyCancelable(RadPropertyMetadata metadata)
Parameters:metadataRadPropertyMetadata

The metadata associated with the property change.

Returns:

bool

Overrides: RadObject.IsPropertyCancelable(RadPropertyMetadata)

Merges the context menu.

C#
public RadDropDownMenu MergeMenus(IContextMenuManager contextMenuManager, params object[] parameters)
Parameters:contextMenuManagerIContextMenuManager

The IContextMenuManager to merge with.

parametersobject[]

merge parameters.

Returns:

RadDropDownMenu

The merged context menu, if successful.

Implements: IContextMenuProvider.MergeMenus(IContextMenuManager, params object[])

Merges the context menu.

C#
public RadDropDownMenu MergeMenus(IContextMenuProvider contextMenuProvider, params object[] parameters)
Parameters:contextMenuProviderIContextMenuProvider

The IContextMenuProvider to merge with.

parametersobject[]

merge parameters.

Returns:

RadDropDownMenu

The merged context menu, if successful.

Implements: IContextMenuProvider.MergeMenus(IContextMenuProvider, params object[])

Merges the context menu.

C#
public RadDropDownMenu MergeMenus(RadDropDownMenu contextMenu, params object[] parameters)
Parameters:contextMenuRadDropDownMenu

The RadDropDownMenu to merge with.

parametersobject[]

merge parameters.

Returns:

RadDropDownMenu

The merged context menu, if successful.

Implements: IContextMenuProvider.MergeMenus(RadDropDownMenu, params object[])

C#
protected virtual void OnNotifyPropertyChanging(PropertyChangingEventArgsEx e)
Parameters:ePropertyChangingEventArgsEx
C#
protected void OnNotifyPropertyChanging(string propertyName)
Parameters:propertyNamestring

Raises the RadPropertyChanged event and the standard .NET PropertyChanged event to notify subscribers of property value changes.

C#
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters:eRadPropertyChangedEventArgs

The RadPropertyChangedEventArgs containing information about the property change.

Overrides: RadObject.OnPropertyChanged(RadPropertyChangedEventArgs)

Raises the RadPropertyChanging event, allowing subscribers to be notified before a property value changes and potentially cancel the change.

C#
protected override void OnPropertyChanging(RadPropertyChangingEventArgs e)
Parameters:eRadPropertyChangingEventArgs

Overrides: RadObject.OnPropertyChanging(RadPropertyChangingEventArgs)

Shows the context menu.

C#
public virtual void ShowContextMenu()

Sorts the specified sort order.

C#
public bool Sort(RadSortOrder sortOrder, bool multiSortMode)
Parameters:sortOrderRadSortOrder

The sort order.

multiSortModebool

if set to true [multi sort mode].

Returns:

bool

Sorts with the specified sort order.

C#
public virtual void Sort(RadSortOrder sortOrder)
Parameters:sortOrderRadSortOrder

The sort order.

Toggles the column sort order.

C#
protected void ToggleSortOrder()

Returns a string representation of the column.

C#
public override string ToString()
Returns:

string

The string representation for the column.

Overrides: object.ToString()

Events

Occurs when a property value is changing.

C#
public event PropertyChangingEventHandlerEx PropertyChanging

Implements: INotifyPropertyChangingEx.PropertyChanging

In this article
DefinitionConstructorsGridViewColumn()GridViewColumn(string, string)GridViewColumn(string)FieldsAllowGroupPropertyAllowHidePropertyAllowReorderPropertyAllowResizePropertyAllowSortPropertyAutoEllipsisPropertyAutoSizeModePropertyDisableHTMLRenderingPropertyEnableExpressionEditorPropertyExpressionPropertyFieldNamePropertyHeaderImagePropertyHeaderSvgImagePropertyHeaderTextAlignmentPropertyHeaderTextPropertyImageLayoutPropertyIsAutoGeneratedPropertyIsCurrentPropertyIsVisiblePropertyMaxWidthPropertyMinWidthPropertyNamePropertyPinPositionPropertyReadOnlyPropertyRenderWidthPropertyRowSpanPropertyShowEditorPropertyStretchVerticallyPropertyTagPropertyTextAlignmentPropertyTextImageRelationPropertyVisibleInColumnChooserPropertyWidthPropertyWrapTextPropertyPropertiesAllowGroupAllowHideAllowReorderAllowResizeAllowSortAutoEllipsisAutoSizeModeConditionalFormattingObjectListContextMenuDisableHTMLRenderingDpiScaleEnableExpressionEditorEventDispatcherExpressionFieldNameHeaderImageHeaderSvgImageHeaderTextHeaderTextAlignmentImageLayoutIndexIsCurrentIsDataBoundIsFieldNamePathIsGroupedIsPinnedIsSortedIsVisibleMaxWidthMinWidthNameOwnerTemplatePinPositionReadOnlyRowSpanSortOrderStretchVerticallyTagTextAlignmentTextImageRelationVisibleInColumnChooserWidthWrapTextMethodsBestFit()CanDragToGroup()CanDragToGroup(GridViewTemplate)CreateConditionalFormattingForm()CreateContextMenuItems(RadDropDownMenu)DispatchEvent(KnownEvents, GridEventType, GridEventDispatchMode, object, object[])GetCellType(GridViewRowInfo)GetDefaultEditor()GetDefaultEditorType()GetDefaultGroupByExpression()GetDefaultMinWidth()GetEventInfo(RadProperty, out GridEventDispatchMode)Initialize()InitializeEditor(IInputEditor)IsPropertyCancelable(RadPropertyMetadata)MergeMenus(IContextMenuManager, params object[])MergeMenus(IContextMenuProvider, params object[])MergeMenus(RadDropDownMenu, params object[])OnNotifyPropertyChanging(PropertyChangingEventArgsEx)OnNotifyPropertyChanging(string)OnPropertyChanged(RadPropertyChangedEventArgs)OnPropertyChanging(RadPropertyChangingEventArgs)ShowContextMenu()Sort(RadSortOrder, bool)Sort(RadSortOrder)ToggleSortOrder()ToString()EventsPropertyChanging
Not finding the help you need?
Contact Support