Class DataGridTemplateColumn
Represents a DataGrid column that hosts template-specified content in its cells.
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.Data.dll
Syntax
public class DataGridTemplateColumn : DataGridColumn
Constructors
| Improve this Doc View SourceDataGridTemplateColumn()
Initializes a new instance of the DataGridTemplateColumn class.
Declaration
public DataGridTemplateColumn()
Properties
| Improve this Doc View SourceCellEditingTemplate
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 |
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 SourceCancelCellEdit(FrameworkElement, Object)
Declaration
protected override void CancelCellEdit(FrameworkElement editingElement, object uneditedValue)
Parameters
Type | Name | Description |
---|---|---|
FrameworkElement | editingElement | |
System.Object | uneditedValue |
Overrides
| Improve this Doc View SourceGenerateEditingElement(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
Exceptions
Type | Condition |
---|---|
System.TypeInitializationException | The CellEditingTemplate is null. |
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
Exceptions
Type | Condition |
---|---|
System.TypeInitializationException | The CellTemplate is null. |
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. |