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
Identifies whether grouping by the column is allowed.
public static RadProperty AllowGroupProperty
Identifies whether users may hide the column.
public static RadProperty AllowHideProperty
Identifies whether the user can reorder the column by dragging it.
public static RadProperty AllowReorderProperty
Identifies whether the user can resize the column.
public static RadProperty AllowResizeProperty
Identifies whether sorting by the column is allowed.
public static RadProperty AllowSortProperty
Identifies whether an ellipsis is shown when cell text does not fit.
public static RadProperty AutoEllipsisProperty
Identifies which cells are considered when BestFit adjusts the column width.
public static RadProperty AutoSizeModeProperty
Identifies whether HTML-like markup is disabled for cell text.
public static RadProperty DisableHTMLRenderingProperty
Identifies whether the column's context menu offers the expression editor.
public static RadProperty EnableExpressionEditorProperty
Identifies the expression used to calculate values for the column; a nonempty expression makes the column read-only.
public static RadProperty ExpressionProperty
Identifies the data-source field or property used by a bound column.
public static RadProperty FieldNameProperty
Identifies the bitmap image displayed in the column header.
public static RadProperty HeaderImageProperty
Identifies the SVG image displayed in the column header.
public static RadProperty HeaderSvgImageProperty
Identifies the alignment of the column header text.
public static RadProperty HeaderTextAlignmentProperty
Identifies the caption displayed in the column header.
public static RadProperty HeaderTextProperty
Identifies how images in the column's cells are laid out.
public static RadProperty ImageLayoutProperty
Identifies whether the column was created automatically from the bound data source.
public static RadProperty IsAutoGeneratedProperty
Identifies whether the current cell in the template belongs to this column.
public static RadProperty IsCurrentProperty
Identifies whether the column is displayed in the grid.
public static RadProperty IsVisibleProperty
Identifies the configured maximum pixel width; a value of 0 does not impose an upper bound.
public static RadProperty MaxWidthProperty
Identifies the minimum pixel width allowed for the column.
public static RadProperty MinWidthProperty
Identifies the unique name used to locate the column in its owning template.
public static RadProperty NameProperty
Identifies whether the column is unpinned or fixed to the left or right while scrolling horizontally.
public static RadProperty PinPositionProperty
Identifies whether cells in the column can be edited; an expression column remains read-only.
public static RadProperty ReadOnlyProperty
Identifies the registered render-width property. Its default is 50, and changes are cancelable.
public static RadProperty RenderWidthProperty
Identifies the vertical span of the column's cells in a column-groups view.
public static RadProperty RowSpanProperty
Identifies the registered ShowEditor property. It defaults to false for this column type;
GridViewCheckBoxColumn overrides the default to true.
public static RadProperty ShowEditorProperty
Identifies whether the column is stretched vertically in a column-groups view.
public static RadProperty StretchVerticallyProperty
Identifies the user-defined object associated with the column.
public static RadProperty TagProperty
Identifies the alignment of cell content.
public static RadProperty TextAlignmentProperty
Identifies the placement of header text relative to its image.
public static RadProperty TextImageRelationProperty
Identifies whether the column is listed in the column chooser.
public static RadProperty VisibleInColumnChooserProperty
Identifies the configured column width used by the layout.
public static RadProperty WidthProperty
Identifies whether cell text wraps within the column.
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()
Adds the column's available sort, grouping, formatting, sizing, and expression commands to its header context menu.
protected virtual void CreateContextMenuItems(RadDropDownMenu menu)
The menu to populate.
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:
Creates the column header menu when the owning template allows header context menus.
public RadDropDownMenu MergeMenus(IContextMenuManager contextMenuManager, params object[] parameters)
The manager requesting the menu.
parametersobject[]Additional merge parameters; this implementation does not use them.
Returns:A newly populated menu, or null if the column is unattached or header menus are disabled.
Implements:
Does not merge another provider's menu; this overload returns null.
public RadDropDownMenu MergeMenus(IContextMenuProvider contextMenuProvider, params object[] parameters)
The provider whose menu would be merged; this implementation does not use it.
parametersobject[]Additional merge parameters; this implementation does not use them.
Returns:null.
Implements:
Does not merge a supplied menu; this overload returns null.
public RadDropDownMenu MergeMenus(RadDropDownMenu contextMenu, params object[] parameters)
The menu to merge; this implementation does not use it.
parametersobject[]Additional merge parameters; this implementation does not use them.
Returns:null.
Implements:
Forwards a pre-change notification to PropertyChanging subscribers.
protected virtual void OnNotifyPropertyChanging(PropertyChangingEventArgsEx e)
The property name and any old or new values supplied by the caller.
Raises the PropertyChanging event for the specified property name.
protected void OnNotifyPropertyChanging(string propertyName)
The name of the property about to change.
Updates dependent column state and dispatches notifications after a property changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The property change details.
Overrides:
Validates width, current-column, visibility, and name changes before applying them.
protected override void OnPropertyChanging(RadPropertyChangingEventArgs e)
The pending property change; width changes may be canceled by the column-width changing event.
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 the column announces a pending property change; the base implementation uses this notification before changing the owner template.
public event PropertyChangingEventHandlerEx PropertyChanging
Implements: