Show / Hide Table of Contents

Class DataGridTextColumn

Represents a DataGrid column that hosts textual content in its cells.

Inheritance
System.Object
DependencyObject
DataGridColumn
DataGridBoundColumn
DataGridTextColumn
Inherited Members
DataGridBoundColumn.Binding
DataGridBoundColumn.ClipboardContentBinding
DataGridBoundColumn.EditingElementStyle
DataGridBoundColumn.ElementStyle
DataGridColumn.ActualWidth
DataGridColumn.CellStyle
DataGridColumn.CanUserReorder
DataGridColumn.CanUserResize
DataGridColumn.CanUserSort
DataGridColumn.DisplayIndex
DataGridColumn.DragIndicatorStyle
DataGridColumn.HeaderStyle
DataGridColumn.Header
DataGridColumn.IsAutoGenerated
DataGridColumn.IsFrozen
DataGridColumn.IsReadOnly
DataGridColumn.MaxWidth
DataGridColumn.MinWidth
DataGridColumn.SortMemberPath
DataGridColumn.Visibility
DataGridColumn.Width
DataGridColumn.GetCellContent(DataGridRow)
DataGridColumn.GetCellContent(Object)
DataGridColumn.GetColumnContainingElement(FrameworkElement)
DataGridColumn.NotifyPropertyChanged(String)
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.INTERNAL_OnAttachedToVisualTree()
DependencyObject.INTERNAL_OnDetachedFromVisualTree()
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Data.dll
Syntax
[StyleTypedProperty(Property = "ElementStyle", StyleTargetType = typeof(TextBlock))]
[StyleTypedProperty(Property = "EditingElementStyle", StyleTargetType = typeof(TextBox))]
public class DataGridTextColumn : DataGridBoundColumn, IDependencyObject

Constructors

| Improve this Doc View Source

DataGridTextColumn()

Initializes a new instance of the DataGridTextColumn class.

Declaration
public DataGridTextColumn()

Fields

| Improve this Doc View Source

FontFamilyProperty

Identifies the FontFamily dependency property.

Declaration
public static readonly DependencyProperty FontFamilyProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

FontFamily

Gets or sets the font name.

Declaration
public FontFamily FontFamily { get; set; }
Property Value
Type Description
FontFamily
| Improve this Doc View Source

FontSize

Gets or sets the font size.

Declaration
public double FontSize { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

FontStyle

Gets or sets the font style.

Declaration
public FontStyle FontStyle { get; set; }
Property Value
Type Description
FontStyle
| Improve this Doc View Source

FontWeight

Gets or sets the font weight or thickness.

Declaration
public FontWeight FontWeight { get; set; }
Property Value
Type Description
FontWeight
| Improve this Doc View Source

Foreground

Gets or sets a brush that describes the foreground of the column cells.

Declaration
public Brush Foreground { get; set; }
Property Value
Type Description
Brush

Methods

| Improve this Doc View Source

CancelCellEdit(FrameworkElement, Object)

Causes the column cell being edited to revert to the specified value.

Declaration
protected override void CancelCellEdit(FrameworkElement editingElement, object uneditedValue)
Parameters
Type Name Description
FrameworkElement editingElement

The element that the column displays for a cell in editing mode.

System.Object uneditedValue

The previous, unedited value in the cell being edited.

Overrides
DataGridColumn.CancelCellEdit(FrameworkElement, Object)
| Improve this Doc View Source

GenerateEditingElement(DataGridCell, Object)

Gets a TextBox control that is bound to the column's Binding property value.

Declaration
protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
Parameters
Type Name Description
DataGridCell cell

The cell that will contain the generated element.

System.Object dataItem

The data item represented by the row that contains the intended cell.

Returns
Type Description
FrameworkElement

A new TextBox control that is bound to the column's Binding property value.

Overrides
DataGridColumn.GenerateEditingElement(DataGridCell, Object)
| Improve this Doc View Source

GenerateElement(DataGridCell, Object)

Gets a read-only TextBlock element that is bound to the column's Binding property value.

Declaration
protected override FrameworkElement GenerateElement(DataGridCell cell, object dataItem)
Parameters
Type Name Description
DataGridCell cell

The cell that will contain the generated element.

System.Object dataItem

The data item represented by the row that contains the intended cell.

Returns
Type Description
FrameworkElement

A new, read-only TextBlock element that is bound to the column's Binding property value.

Overrides
DataGridColumn.GenerateElement(DataGridCell, Object)
| Improve this Doc View Source

PrepareCellForEdit(FrameworkElement, RoutedEventArgs)

Called when the cell in the column enters editing mode.

Declaration
protected override object PrepareCellForEdit(FrameworkElement editingElement, RoutedEventArgs editingEventArgs)
Parameters
Type Name Description
FrameworkElement editingElement

The element that the column displays for a cell in editing mode.

RoutedEventArgs editingEventArgs

Information about the user gesture that is causing a cell to enter editing mode.

Returns
Type Description
System.Object

The unedited value.

Overrides
DataGridColumn.PrepareCellForEdit(FrameworkElement, RoutedEventArgs)
| Improve this Doc View Source

RefreshCellContent(FrameworkElement, String)

Called by the DataGrid control when this column asks for its elements to be updated, because a property changed.

Declaration
protected override void RefreshCellContent(FrameworkElement element, string propertyName)
Parameters
Type Name Description
FrameworkElement element
System.String propertyName
Overrides
DataGridColumn.RefreshCellContent(FrameworkElement, String)

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
  • Improve this Doc
  • View Source