Show / Hide Table of Contents

Class DataGridTemplateColumn

Represents a DataGrid column that hosts template-specified content in its cells.

Inheritance
System.Object
DependencyObject
DataGridColumn
DataGridTemplateColumn
Inherited Members
DataGridColumn.ActualWidth
DataGridColumn.CellStyle
DataGridColumn.CanUserReorder
DataGridColumn.CanUserResize
DataGridColumn.CanUserSort
DataGridColumn.ClipboardContentBinding
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)
DataGridColumn.RefreshCellContent(FrameworkElement, 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
public class DataGridTemplateColumn : DataGridColumn, IDependencyObject

Constructors

| Improve this Doc View Source

DataGridTemplateColumn()

Initializes a new instance of the DataGridTemplateColumn class.

Declaration
public DataGridTemplateColumn()

Properties

| Improve this Doc View Source

CellEditingTemplate

Gets or sets the template that is used to display the contents of a cell that is in editing mode.

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

CellTemplate

Gets or sets the template that is used to display the contents of a cell that is not in editing mode.

Declaration
public DataTemplate CellTemplate { get; set; }
Property Value
Type Description
DataTemplate

Methods

| Improve this Doc View Source

CancelCellEdit(FrameworkElement, Object)

Ends the edit on a data grid cell and reverts any changes.

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 value of the data prior to the edit.

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

GenerateEditingElement(DataGridCell, Object)

Gets an element defined by the CellEditingTemplate 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 editing element that is bound to the column's Binding property value.

Overrides
DataGridColumn.GenerateEditingElement(DataGridCell, Object)
Exceptions
Type Condition
System.TypeInitializationException

The CellEditingTemplate is null.

| Improve this Doc View Source

GenerateElement(DataGridCell, Object)

Gets an element defined by the CellTemplate 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 element that is bound to the column's Binding property value.

Overrides
DataGridColumn.GenerateElement(DataGridCell, Object)
Exceptions
Type Condition
System.TypeInitializationException

The CellTemplate is null.

| Improve this Doc View Source

PrepareCellForEdit(FrameworkElement, RoutedEventArgs)

Called when a 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

null in all cases.

Overrides
DataGridColumn.PrepareCellForEdit(FrameworkElement, RoutedEventArgs)

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