Export (0) Print
Expand All

DataGridColumn Class

Represents a DataGrid column.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public ref class DataGridColumn abstract : public DependencyObject

The DataGridColumn type exposes the following members.

  NameDescription
Protected methodDataGridColumnInitializes a new instance of the DataGridColumn class.
Top

  NameDescription
Public propertyActualWidthGets the current width of the column, in device-independent units (1/96th inch per unit).
Public propertyCanUserReorderGets or sets a value that indicates whether the user can change the column display position by dragging the column header.
Public propertyCanUserResizeGets or sets a value that indicates whether the user can adjust the column width by using the mouse.
Public propertyCanUserSortGets or sets a value that indicates whether the user can sort the column by clicking the column header.
Public propertyCellStyleGets or sets the style that is used to render cells in the column.
Public propertyClipboardContentBindingGets or sets the binding object to use when getting or setting cell content for the clipboard.
Protected propertyDataGridOwnerGets the DataGrid control that contains this column.
Public propertyDependencyObjectTypeGets the DependencyObjectType that wraps the CLR type of this instance.  (Inherited from DependencyObject.)
Public propertyDispatcherGets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Public propertyDisplayIndexGets or sets the display position of the column relative to the other columns in the DataGrid.
Public propertyDragIndicatorStyleGets or sets the style object to apply to the column header during a drag operation.
Public propertyHeaderGets or sets the content of the column header.
Public propertyHeaderStringFormatGets or sets the format pattern to apply to the content of the column header.
Public propertyHeaderStyleGets or sets the style that is used when rendering the column header.
Public propertyHeaderTemplateGets or sets the template that defines the visual representation of the column header.
Public propertyHeaderTemplateSelectorGets or sets the object that selects which template to use for the column header.
Public propertyIsAutoGeneratedGets a value that indicates whether the column is auto-generated.
Public propertyIsFrozenGets a value that indicates whether the column is prevented from scrolling horizontally.
Public propertyIsReadOnlyGets or sets a value that indicates whether cells in the column can be edited.
Public propertyIsSealedGets a value that indicates whether this instance is currently sealed (read-only). (Inherited from DependencyObject.)
Public propertyMaxWidthGets or sets the maximum width constraint of the column.
Public propertyMinWidthGets or sets the minimum width constraint of the column.
Public propertySortDirectionGets or sets the sort direction (ascending or descending) of the column.
Public propertySortMemberPathGets or sets a property name, or a period-delimited hierarchy of property names, that indicates the member to sort by.
Public propertyVisibilityGets or sets the visibility of the column.
Public propertyWidthGets or sets the column width or automatic sizing mode.
Top

  NameDescription
Protected methodCancelCellEditCauses the cell being edited to revert to the original, unedited value.
Public methodCheckAccessDetermines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Public methodClearValue(DependencyProperty)Clears the local value of a property. The property to be cleared is specified by a DependencyProperty identifier. (Inherited from DependencyObject.)
Public methodClearValue(DependencyPropertyKey)Clears the local value of a read-only property. The property to be cleared is specified by a DependencyPropertyKey. (Inherited from DependencyObject.)
Public methodCoerceValueCoerces the value of the specified dependency property. This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject. (Inherited from DependencyObject.)
Protected methodCommitCellEditPerforms any required validation before exiting cell editing mode.
Public methodEqualsDetermines whether a provided DependencyObject is equivalent to the current DependencyObject. (Inherited from DependencyObject.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Protected methodGenerateEditingElementWhen overridden in a derived class, gets an editing element that is bound to the Binding property value of the column.
Protected methodGenerateElementWhen overridden in a derived class, gets a read-only element that is bound to the Binding property value of the column.
Public methodGetCellContent(DataGridRow)Retrieves the Content property value for the cell at the intersection of this column and the specified row.
Public methodGetCellContent(Object)Gets the Content property value for the cell at the intersection of this column and the row that represents the specified data item.
Public methodGetHashCodeGets a hash code for this DependencyObject. (Inherited from DependencyObject.)
Public methodGetLocalValueEnumeratorCreates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject. (Inherited from DependencyObject.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetValueReturns the current effective value of a dependency property on this instance of a DependencyObject. (Inherited from DependencyObject.)
Public methodInvalidatePropertyRe-evaluates the effective value for the specified dependency property (Inherited from DependencyObject.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodNotifyPropertyChangedNotifies the DataGrid that contains this column that a column property has changed.
Protected methodOnCoerceIsReadOnlyDetermines the value of the IsReadOnly property based on the property rules of the DataGrid that contains this column.
Public methodOnCopyingCellClipboardContentRaises the CopyingCellClipboardContent event.
Public methodOnPastingCellClipboardContentRaises the PastingCellClipboardContent event.
Protected methodOnPropertyChangedInvoked whenever the effective value of any dependency property on this DependencyObject has been updated. The specific dependency property that changed is reported in the event data. (Inherited from DependencyObject.)
Protected methodPrepareCellForEditWhen overridden in a derived class, sets cell content as needed for editing.
Public methodReadLocalValueReturns the local value of a dependency property, if it exists. (Inherited from DependencyObject.)
Protected methodRefreshCellContentWhen overridden in a derived class, updates the contents of a cell in the column in response to a column property value that changed.
Public methodSetCurrentValueSets the value of a dependency property without changing its value source. (Inherited from DependencyObject.)
Public methodSetValue(DependencyProperty, Object)Sets the local value of a dependency property, specified by its dependency property identifier. (Inherited from DependencyObject.)
Public methodSetValue(DependencyPropertyKey, Object)Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property. (Inherited from DependencyObject.)
Protected methodShouldSerializePropertyReturns a value that indicates whether serialization processes should serialize the value for the provided dependency property. (Inherited from DependencyObject.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodVerifyAccessEnforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Top

  NameDescription
Public eventCopyingCellClipboardContentOccurs after the cell clipboard content is prepared.
Public eventPastingCellClipboardContentOccurs before the clipboard content is moved to the cell.
Top

  NameDescription
Public fieldStatic memberActualWidthPropertyIdentifies the ActualWidth dependency property.
Public fieldStatic memberCanUserReorderPropertyIdentifies the CanUserReorder dependency property.
Public fieldStatic memberCanUserResizePropertyIdentifies the CanUserResize dependency property.
Public fieldStatic memberCanUserSortPropertyIdentifies the CanUserSort dependency property.
Public fieldStatic memberCellStylePropertyIdentifies the CellStyle dependency property.
Public fieldStatic memberDisplayIndexPropertyIdentifies the DisplayIndex dependency property.
Public fieldStatic memberDragIndicatorStylePropertyIdentifies the DragIndicatorStyle dependency property.
Public fieldStatic memberHeaderPropertyIdentifies the Header dependency property.
Public fieldStatic memberHeaderStringFormatPropertyIdentifies the HeaderStringFormat dependency property.
Public fieldStatic memberHeaderStylePropertyIdentifies the HeaderStyle dependency property.
Public fieldStatic memberHeaderTemplatePropertyIdentifies the HeaderTemplate dependency property.
Public fieldStatic memberHeaderTemplateSelectorPropertyIdentifies the HeaderTemplateSelector dependency property.
Public fieldStatic memberIsAutoGeneratedPropertyIdentifies the IsAutoGenerated dependency property.
Public fieldStatic memberIsFrozenPropertyIdentifies the IsFrozen dependency property.
Public fieldStatic memberIsReadOnlyPropertyIdentifies the IsReadOnly dependency property.
Public fieldStatic memberMaxWidthPropertyIdentifies the MaxWidth dependency property.
Public fieldStatic memberMinWidthPropertyIdentifies the MinWidth dependency property.
Public fieldStatic memberSortDirectionPropertyIdentifies the SortDirection dependency property.
Public fieldStatic memberSortMemberPathPropertyIdentifies the SortMemberPath dependency property.
Public fieldStatic memberVisibilityPropertyIdentifies the Visibility dependency property.
Public fieldStatic memberWidthPropertyIdentifies the Width dependency property.
Top

This abstract class provides the base functionality for all DataGrid columns.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft