Class DataGridTextColumn
Represents a DataGrid column that hosts textual content in its cells.
Inherited Members
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
Constructors
| Improve this Doc View SourceDataGridTextColumn()
Initializes a new instance of the DataGridTextColumn class.
Declaration
public DataGridTextColumn()
Fields
| Improve this Doc View SourceFontFamilyProperty
Identifies the FontFamily dependency property.
Declaration
public static readonly DependencyProperty FontFamilyProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceFontFamily
Gets or sets the font name.
Declaration
public FontFamily FontFamily { get; set; }
Property Value
Type | Description |
---|---|
FontFamily |
FontSize
Gets or sets the font size.
Declaration
public double FontSize { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
FontStyle
Gets or sets the font style.
Declaration
public FontStyle FontStyle { get; set; }
Property Value
Type | Description |
---|---|
FontStyle |
FontWeight
Gets or sets the font weight or thickness.
Declaration
public FontWeight FontWeight { get; set; }
Property Value
Type | Description |
---|---|
FontWeight |
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 SourceCancelCellEdit(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
| Improve this Doc View SourceGenerateEditingElement(DataGridCell, Object)
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
| Improve this Doc View SourceGenerateElement(DataGridCell, Object)
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
| Improve this Doc View SourcePrepareCellForEdit(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
| Improve this Doc View SourceRefreshCellContent(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 |