DataGridPartEditBoxColumnBase<T> Class
Represents a base class for data-bound columns for use in a DataGrid that utilize PartEditBoxBase-derived controls.
public abstract class DataGridPartEditBoxColumnBase<T> : DataGridBoundColumnBase
- Type Parameters:
-
T-The type of value being edited.
- Inheritance:
- object DataGridColumn DataGridBoundColumn DataGridBoundColumnBase object
- Derived:
- DataGridBrushColumn DataGridByteColumn DataGridColorColumn DataGridCornerRadiusColumn DataGridDateTimeColumn DataGridDecimalColumn DataGridDoubleColumn DataGridEnumColumn DataGridGuidColumn DataGridInt16Column DataGridInt32Column DataGridInt32RectColumn DataGridInt64Column DataGridPointColumn DataGridRectColumn DataGridSingleColumn DataGridSizeColumn DataGridThicknessColumn DataGridTimeSpanColumn DataGridVectorColumn
Constructors
DataGridPartEditBoxColumnBase()
Initializes an instance of the class.
protected DataGridPartEditBoxColumnBase()
Properties
CommitTriggers
The triggers that will force this control to commit any changes.
public PartEditBoxCommitTriggers CommitTriggers { get; set; }
Property Value
- PartEditBoxCommitTriggers:
The default value is Default.
DefaultEditingElementStyle
The default value for the EditingElementStyleProperty dependency property.
DefaultElementStyle
The default value for the EditingElementStyleProperty dependency property.
HasPopup
Indicates whether the control has a popup available.
public bool HasPopup { get; set; }
Property Value
- bool:
trueif the control has a popup available; otherwisefalse. The default value istrue.
IsArrowKeyPartNavigationEnabled
Indicates whether the left/right arrow keys can be used to move between and select editable parts.
public bool IsArrowKeyPartNavigationEnabled { get; set; }
Property Value
- bool:
trueif the left/right arrow keys can be used to move between and select editable parts; otherwisefalse. The default value istrue.
IsEditable
Indicates whether the edit box's text area is editable.
public bool IsEditable { get; set; }
Property Value
- bool:
trueif the edit box's text area is editable; otherwisefalse. The default value istrue.
Remarks
When false, the edit box behaves more like a ComboBox.
IsNullAllowed
Indicates whether null values are allowed to be entered by the user.
public bool IsNullAllowed { get; set; }
Property Value
- bool:
trueifnullvalues are allowed to be entered by the user; otherwisefalse. The default value isfalse.
IsUndoEnabled
Indicates whether undo/redo support is enabled for the text-editing portion of the control.
public bool IsUndoEnabled { get; set; }
Property Value
- bool:
trueif undo/redo support is enabled for the text-editing portion of the control. The default value istrue.
PlaceholderText
The text that is displayed in the control until the value is changed by a user action or some other operation.
SpinWrapping
The wrapping behavior used when spinning past a minimum or maximum value in the active part.
public SpinWrapping SpinWrapping { get; set; }
Property Value
- SpinWrapping:
The default value is NoWrap.
SpinnerVisibility
A value indicating if and when the control has a spinner available.
public SpinnerVisibility SpinnerVisibility { get; set; }
Property Value
- SpinnerVisibility:
The default value is Collapsed.
TextAlignment
The text alignment of the text editing area.
public TextAlignment TextAlignment { get; set; }
Property Value
- TextAlignment:
The default value is Left.
Methods
ApplyStandardValues(FrameworkElement)
Applies standard values to the specified target element.
protected virtual void ApplyStandardValues(FrameworkElement targetElement)
| Parameter | Type | Description |
|---|---|---|
| targetElement | FrameworkElement | The target element. |
GenerateEditBox(bool, DataGridCell)
Generates an instance of a PartEditBoxBase-derived object.
protected virtual PartEditBoxBase<T> GenerateEditBox(bool isEditing, DataGridCell cell)
| Parameter | Type | Description |
|---|---|---|
| isEditing | bool | Whether the edit box will be used for editing. |
| cell | DataGridCell | The cell. |
Returns
- PartEditBoxBase<T>:
An instance of a
PartEditBoxBase-derived object.
GenerateEditingElement(DataGridCell, object)
When overridden in a derived class, gets an editing element that is bound to the Binding property value of the column.
protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
| Parameter | Type | Description |
|---|---|---|
| cell | DataGridCell | The cell that will contain the generated element. |
| dataItem | object | The data item that is represented by the row that contains the intended cell. |
Returns
- FrameworkElement:
A new editing element that is bound to the Binding property value of the column.
GenerateElement(DataGridCell, object)
When overridden in a derived class, gets a read-only element that is bound to the Binding property value of the column.
protected override FrameworkElement GenerateElement(DataGridCell cell, object dataItem)
| Parameter | Type | Description |
|---|---|---|
| cell | DataGridCell | The cell that will contain the generated element. |
| dataItem | object | The data item that is represented by the row that contains the intended cell. |
Returns
- FrameworkElement:
A new read-only element that is bound to the Binding property value of the column.
GetEditBoxType()
The type of the associated PartEditBoxBase-derived control.
PrepareCellForEdit(FrameworkElement, RoutedEventArgs)
When overridden in a derived class, sets cell content as needed for editing.
protected override object? PrepareCellForEdit(FrameworkElement editingElement, RoutedEventArgs editingEventArgs)
| Parameter | Type | Description |
|---|---|---|
| editingElement | FrameworkElement | The element that the column displays for a cell in editing mode. |
| editingEventArgs | RoutedEventArgs | Information about the user gesture that is causing a cell to enter editing mode. |
Returns
- object:
When returned by a derived class, the unedited cell value. This implementation returns
nullin all cases.
Fields
CommitTriggersProperty
Defines the CommitTriggers property.
public static readonly DependencyProperty CommitTriggersProperty
HasPopupProperty
Defines the HasPopup property.
public static readonly DependencyProperty HasPopupProperty
IsArrowKeyPartNavigationEnabledProperty
Defines the IsArrowKeyPartNavigationEnabled property.
public static readonly DependencyProperty IsArrowKeyPartNavigationEnabledProperty
IsEditableProperty
Defines the IsEditable property.
public static readonly DependencyProperty IsEditableProperty
IsNullAllowedProperty
Defines the IsNullAllowed property.
public static readonly DependencyProperty IsNullAllowedProperty
IsUndoEnabledProperty
Defines the IsUndoEnabled property.
public static readonly DependencyProperty IsUndoEnabledProperty
PlaceholderTextProperty
Defines the PlaceholderText property.
public static readonly DependencyProperty PlaceholderTextProperty
SpinWrappingProperty
Defines the SpinWrapping property.
public static readonly DependencyProperty SpinWrappingProperty
SpinnerVisibilityProperty
Defines the SpinnerVisibility property.
public static readonly DependencyProperty SpinnerVisibilityProperty
TextAlignmentProperty
Defines the TextAlignment property.
public static readonly DependencyProperty TextAlignmentProperty
Inherited Members
- DataGridBoundColumnBase.ApplyBinding(FrameworkElement, DependencyProperty)
- DataGridBoundColumnBase.ApplyValue(DependencyProperty, FrameworkElement, DependencyProperty)
- DataGridBoundColumnBase.RefreshCellContent(FrameworkElement, string)