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 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
Initializes a new instance of the GridViewColumn.
public GridViewColumn()
Initializes a new instance of the GridViewColumn.
Initializes a new instance of the GridViewColumn.
public GridViewColumn(string fieldName)
A string value referring to the unique name of the column.
Fields
public static RadProperty AllowGroupProperty
public static RadProperty AllowHideProperty
public static RadProperty AllowReorderProperty
public static RadProperty AllowResizeProperty
public static RadProperty AllowSortProperty
public static RadProperty AutoEllipsisProperty
public static RadProperty AutoSizeModeProperty
public static RadProperty DisableHTMLRenderingProperty
public static RadProperty EnableExpressionEditorProperty
public static RadProperty ExpressionProperty
public static RadProperty FieldNameProperty
public static RadProperty HeaderImageProperty
public static RadProperty HeaderSvgImageProperty
public static RadProperty HeaderTextAlignmentProperty
public static RadProperty HeaderTextProperty
public static RadProperty ImageLayoutProperty
public static RadProperty IsAutoGeneratedProperty
public static RadProperty IsCurrentProperty
public static RadProperty IsVisibleProperty
public static RadProperty MaxWidthProperty
public static RadProperty MinWidthProperty
public static RadProperty NameProperty
public static RadProperty PinPositionProperty
public static RadProperty ReadOnlyProperty
public static RadProperty RenderWidthProperty
public static RadProperty RowSpanProperty
public static RadProperty ShowEditorProperty
public static RadProperty StretchVerticallyProperty
public static RadProperty TagProperty
public static RadProperty TextAlignmentProperty
public static RadProperty TextImageRelationProperty
public static RadProperty VisibleInColumnChooserProperty
public static RadProperty WidthProperty
public static RadProperty WrapTextProperty
Properties
Gets or sets a value indicating whether the user can group data based on the content of this column.
[Browsable(true)]
public virtual bool AllowGroup { get; set; }
Gets or sets value indicating whether the user can hide the column.
[Browsable(true)]
public virtual bool AllowHide { get; set; }
Gets or sets a value indicating whether the user can reorder this column using the mouse.
[Browsable(true)]
public virtual bool AllowReorder { get; set; }
Gets or sets value indicating whether the user can resize the column.
[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.
[Browsable(true)]
public virtual bool AllowSort { get; set; }
Gets or sets the auto ellipsis.
[Browsable(true)]
public bool AutoEllipsis { get; set; }
The auto ellipsis.
Gets or sets the mode by which the column automatically adjusts its width after BestFit is executed.
[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.
[Browsable(true)]
public virtual ConditionalFormattingObjectCollection ConditionalFormattingObjectList { get; }
Gets or sets the context menu assigned to the column.
public RadDropDownMenu ContextMenu { get; set; }
Implements:
Disable or Enable HTML-like text rendering in the column.
[Browsable(true)]
public bool DisableHTMLRendering { get; set; }
Gets or sets the DPI scale.
public SizeF DpiScale { get; }
The dpi scale.
Gets or sets the value indicating if expression editor menu item will be available to the user.
[Browsable(true)]
public bool EnableExpressionEditor { get; set; }
Gets the event dispatcher.
protected EventDispatcher EventDispatcher { get; }
The event dispatcher.
Gets or sets the expression used to calculate the values of this column.
[Browsable(true)]
public string Expression { get; set; }
Gets or sets the name data source property or database column to which the GridViewDataColumn is bound.
[Browsable(true)]
public string FieldName { get; set; }
Gets or set the ColumnInfo Header image.
[Browsable(true)]
[TypeConverter(typeof(ImageTypeConverter))]
public virtual Image HeaderImage { get; set; }
Gets or set the ColumnInfo Header vector image.
[Browsable(true)]
[TypeConverter(typeof(SvgImageTypeConverter))]
public virtual RadSvgImage HeaderSvgImage { get; set; }
Gets or sets the caption text on the column's header cell.
[Browsable(true)]
public virtual string HeaderText { get; set; }
Gets or sets a value indicating the position of the HeaderText within the header cell.
[Browsable(true)]
public ContentAlignment HeaderTextAlignment { get; set; }
Gets or sets the image layout of the image inside the cells.
[Browsable(true)]
public virtual ImageLayout ImageLayout { get; set; }
Gets a value indicating the position of the column in the Columns collection of the OwnerTemplate.
[Browsable(false)]
public int Index { get; }
Gets value indicating whether the column contains the currently selected cell in the OwnerTemplate.
[Browsable(false)]
public bool IsCurrent { get; set; }
Gets a value indicating whether the column is bound to the data field referred by FieldName.
[Browsable(false)]
public virtual bool IsDataBound { get; }
Gets whether is field name path.
[Browsable(false)]
public bool IsFieldNamePath { get; }
The is field name path.
Gets a value indicating whether the data in the OwnerTemplate is grouped based on the content of this column.
[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.
[Browsable(true)]
public bool IsPinned { get; set; }
Gets a boolean value indicating whether a sort order of data in the column is currently applied.
[Browsable(false)]
public virtual bool IsSorted { get; }
When multi-column sorting is applied, the column might be partially sorted.
Gets or sets a value indicating whether the column is visible.
[Browsable(true)]
public virtual bool IsVisible { get; set; }
Gets or sets the maximal width, in pixels, of the column.
[Browsable(true)]
public int MaxWidth { get; set; }
Gets or sets the minimum width, in pixels, of the column.
[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.
[Browsable(true)]
public virtual string Name { get; set; }
Gets the instance of GridViewTemplate which the column belongs to.
[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.
public PinnedColumnPosition PinPosition { get; set; }
Gets or sets a value indicating whether the user can edit the data in the column's cells.
[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.
[Browsable(true)]
public int RowSpan { get; set; }
Gets or sets a value indicating the sort order of data in the column.
[Browsable(true)]
public RadSortOrder SortOrder { get; set; }
Gets or sets a value indicating whether to stretch the column height vertically. Used with ColumnGroupsViewDefinition.
[Browsable(true)]
public bool StretchVertically { get; set; }
Gets or sets the object that contains data about the column.
[Browsable(false)]
public object Tag { get; set; }
Gets or sets a value indicating the position of the cell content within a column's cells.
[Browsable(true)]
public virtual ContentAlignment TextAlignment { get; set; }
Gets or sets a value indicating the TextImageRelation: ImageAboveText, ImageBeforeText, Overlay, TextAboveImage, and TextBeforeImage.
[Browsable(true)]
public TextImageRelation TextImageRelation { get; set; }
Gets or sets a value indicating whether the column will be visible in ColumnChooserElement.
[Browsable(true)]
public virtual bool VisibleInColumnChooser { get; set; }
Use this property if you want to hide columns from the user.
Gets or sets the width of the column.
[Browsable(true)]
public virtual int Width { get; set; }
Methods
Adjusts the column width to fit the contents of all cells in the column, including the header cell.
public void BestFit()
Determines whether this column may be dragged onto the GroupBy panel.
Determines whether this column may be dragged onto the GroupBy panel.
public bool CanDragToGroup(GridViewTemplate template)
Creates the conditional formatting form.
protected virtual ConditionalFormattingForm CreateConditionalFormattingForm()
protected virtual void CreateContextMenuItems(RadDropDownMenu menu)
Dispatches the event.
protected virtual void DispatchEvent(KnownEvents id, GridEventType type, GridEventDispatchMode dispatchMode, object originator, object[] arguments)
The id.
typeGridEventTypeThe type.
dispatchModeGridEventDispatchModeThe dispatch mode.
originatorobjectThe originator.
argumentsobject[]The arguments.
Returns the type of cell element to be created for the specified row.
public virtual Type GetCellType(GridViewRowInfo row)
The specified row.
Returns:The type of the cell to be created.
Returns an editor instance of the default type for the editor provider.
public virtual IInputEditor GetDefaultEditor()
An object that implements IInputEditor interface.
Implements:
Gets the default editor type for the editor provider.
Retrieves the default group-by expression string for the column.
public virtual string GetDefaultGroupByExpression()
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.
Gets the event info.
protected virtual GridEventType GetEventInfo(RadProperty property, out GridEventDispatchMode dispatchMode)
The property.
dispatchModeGridEventDispatchModeThe dispatch mode.
Returns:Initializes the column.
protected virtual void Initialize()
This method is called when the column is associated with GridViewTemplate.
Initializes a specified editor.
public virtual void InitializeEditor(IInputEditor editor)
An object that implements IInputEditor interface.
Implements:
Determines whether the specified property may be canceled.
protected override bool IsPropertyCancelable(RadPropertyMetadata metadata)
The metadata associated with the property change.
Returns:Overrides:
Merges the context menu.
public RadDropDownMenu MergeMenus(IContextMenuManager contextMenuManager, params object[] parameters)
The IContextMenuManager to merge with.
parametersobject[]merge parameters.
Returns:The merged context menu, if successful.
Implements:
Merges the context menu.
public RadDropDownMenu MergeMenus(IContextMenuProvider contextMenuProvider, params object[] parameters)
The IContextMenuProvider to merge with.
parametersobject[]merge parameters.
Returns:The merged context menu, if successful.
Implements:
Merges the context menu.
public RadDropDownMenu MergeMenus(RadDropDownMenu contextMenu, params object[] parameters)
The RadDropDownMenu to merge with.
parametersobject[]merge parameters.
Returns:The merged context menu, if successful.
Implements:
protected virtual void OnNotifyPropertyChanging(PropertyChangingEventArgsEx e)
Raises the RadPropertyChanged event and the standard .NET PropertyChanged event to notify subscribers of property value changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The RadPropertyChangedEventArgs containing information about the property change.
Overrides:
Raises the RadPropertyChanging event, allowing subscribers to be notified before a property value changes and potentially cancel the change.
protected override void OnPropertyChanging(RadPropertyChangingEventArgs e)
Overrides:
Shows the context menu.
public virtual void ShowContextMenu()
Sorts the specified sort order.
public bool Sort(RadSortOrder sortOrder, bool multiSortMode)
The sort order.
multiSortModeboolif set to true [multi sort mode].
Sorts with the specified sort order.
Toggles the column sort order.
protected void ToggleSortOrder()
Returns a string representation of the column.
public override string ToString()
The string representation for the column.
Overrides:
Events
Occurs when a property value is changing.
public event PropertyChangingEventHandlerEx PropertyChanging
Implements: