DataGrid Class

Summary

Displays data in a customizable grid.
graph TD Base0["TemplatedControl"]-->Type click Base0 "/api/Avalonia.Controls.Primitives/TemplatedControl" Base1["Control"]-->Base0 click Base1 "/api/Avalonia.Controls/Control" Base2["InputElement"]-->Base1 click Base2 "/api/Avalonia.Input/InputElement" Base3["Interactive"]-->Base2 click Base3 "/api/Avalonia.Interactivity/Interactive" Base4["Layoutable"]-->Base3 click Base4 "/api/Avalonia.Layout/Layoutable" Base5["Visual"]-->Base4 click Base5 "/api/Avalonia/Visual" Base6["StyledElement"]-->Base5 click Base6 "/api/Avalonia/StyledElement" Base7["Animatable"]-->Base6 click Base7 "/api/Avalonia.Animation/Animatable" Base8["AvaloniaObject"]-->Base7 click Base8 "/api/Avalonia/AvaloniaObject" Base9["object"]-->Base8 Interface0["IAvaloniaObjectDebug"]-.->Type click Interface0 "/api/Avalonia.Diagnostics/IAvaloniaObjectDebug" Interface1["INotifyPropertyChanged"]-.->Type Interface2["ISetLogicalParent"]-.->Type click Interface2 "/api/Avalonia.Controls/ISetLogicalParent" Interface3["ISetInheritanceParent"]-.->Type click Interface3 "/api/Avalonia.Controls/ISetInheritanceParent" Interface4["IControl"]-.->Type click Interface4 "/api/Avalonia.Controls/IControl" Interface5["IDataTemplateHost"]-.->Type click Interface5 "/api/Avalonia.Controls.Templates/IDataTemplateHost" Interface6["ILayoutable"]-.->Type click Interface6 "/api/Avalonia.Layout/ILayoutable" Interface7["IInputElement"]-.->Type click Interface7 "/api/Avalonia.Input/IInputElement" Interface8["IInteractive"]-.->Type click Interface8 "/api/Avalonia.Interactivity/IInteractive" Interface9["IVisual"]-.->Type click Interface9 "/api/Avalonia.VisualTree/IVisual" Interface10["IStyledElement"]-.->Type click Interface10 "/api/Avalonia/IStyledElement" Interface11["IStyleable"]-.->Type click Interface11 "/api/Avalonia.Styling/IStyleable" Interface12["IStyleHost"]-.->Type click Interface12 "/api/Avalonia.Styling/IStyleHost" Interface13["ILogical"]-.->Type click Interface13 "/api/Avalonia.LogicalTree/ILogical" Interface14["IResourceNode"]-.->Type click Interface14 "/api/Avalonia.Controls/IResourceNode" Interface15["IResourceProvider"]-.->Type click Interface15 "/api/Avalonia.Controls/IResourceProvider" Interface16["INamed"]-.->Type click Interface16 "/api/Avalonia/INamed" Interface17["ISupportInitialize"]-.->Type Interface18["IVisualBrushInitialize"]-.->Type click Interface18 "/api/Avalonia.Rendering/IVisualBrushInitialize" Interface19["IRequiresTemplateInSetter"]-.->Type click Interface19 "/api/Avalonia.Styling/IRequiresTemplateInSetter" Interface20["ITemplatedControl"]-.->Type click Interface20 "/api/Avalonia.Styling/ITemplatedControl" Interface21["IAvaloniaObject"]-.->Type click Interface21 "/api/Avalonia/IAvaloniaObject" Type["DataGrid"] class Type type-node

Syntax

public class DataGrid : TemplatedControl, IAvaloniaObjectDebug, INotifyPropertyChanged, 
    ISetLogicalParent, ISetInheritanceParent, IControl, IDataTemplateHost, ILayoutable, 
    IInputElement, IInteractive, IVisual, IStyledElement, IStyleable, IStyleHost, ILogical, 
    IResourceNode, IResourceProvider, INamed, ISupportInitialize, IVisualBrushInitialize, 
    IRequiresTemplateInSetter, ITemplatedControl, IAvaloniaObject

Constructors

Name Summary
DataGrid() Initializes a new instance of the DataGrid class.

Events

Name Type Summary
AttachedToLogicalTree EventHandler<LogicalTreeAttachmentEventArgs>
Raised when the styled element is attached to a rooted logical tree.
Inherited from StyledElement
AttachedToVisualTree EventHandler<VisualTreeAttachmentEventArgs>
Raised when the control is attached to a rooted visual tree.
Inherited from Visual
AutoGeneratingColumn EventHandler<DataGridAutoGeneratingColumnEventArgs>
Occurs one time for each public, non-static property in the bound data type when the Avalonia.Controls.DataGrid.ItemsSource property is changed and the AutoGenerateColumns property is true.
BeginningEdit EventHandler<DataGridBeginningEditEventArgs>
Occurs before a cell or row enters editing mode.
CellEditEnded EventHandler<DataGridCellEditEndedEventArgs>
Occurs after cell editing has ended.
CellEditEnding EventHandler<DataGridCellEditEndingEventArgs>
Occurs immediately before cell editing has ended.
CellPointerPressed EventHandler<DataGridCellPointerPressedEventArgs>
Occurs when cell is mouse-pressed.
ColumnDisplayIndexChanged EventHandler<DataGridColumnEventArgs>
Occurs when the DisplayIndex property of a column changes.
ColumnReordered EventHandler<DataGridColumnEventArgs>
Raised when column reordering ends, to allow subscribers to clean up.
ColumnReordering EventHandler<DataGridColumnReorderingEventArgs>
Raised when starting a column reordering action. Subscribers to this event can set tooltip and caret UIElements, constrain tooltip position, indicate that a preview should be shown, or cancel reordering.
CopyingRowClipboardContent EventHandler<DataGridRowClipboardEventArgs>
This event is raised by OnCopyingRowClipboardContent method after the default row content is prepared. Event listeners can modify or add to the row clipboard content.
CurrentCellChanged EventHandler<EventArgs>
Occurs when a different cell becomes the current cell.
DataContextChanged EventHandler
Occurs when the DataContext property changes.
Inherited from StyledElement
DetachedFromLogicalTree EventHandler<LogicalTreeAttachmentEventArgs>
Raised when the styled element is detached from a rooted logical tree.
Inherited from StyledElement
DetachedFromVisualTree EventHandler<VisualTreeAttachmentEventArgs>
Raised when the control is detached from a rooted visual tree.
Inherited from Visual
DoubleTapped EventHandler<RoutedEventArgs>
Occurs when a double-tap gesture occurs on the control.
Inherited from InputElement
GotFocus EventHandler<GotFocusEventArgs>
Occurs when the control receives focus.
Inherited from InputElement
Initialized EventHandler
Occurs when the styled element has finished initialization.
Inherited from StyledElement
KeyDown EventHandler<KeyEventArgs>
Occurs when a key is pressed while the control has focus.
Inherited from InputElement
KeyUp EventHandler<KeyEventArgs>
Occurs when a key is released while the control has focus.
Inherited from InputElement
LayoutUpdated EventHandler
Occurs when a layout pass completes for the control.
Inherited from Layoutable
LoadingRow EventHandler<DataGridRowEventArgs>
Occurs after a DataGridRow is instantiated, so that you can customize it before it is used.
LoadingRowDetails EventHandler<DataGridRowDetailsEventArgs>
Occurs when a new row details template is applied to a row, so that you can customize the details section before it is used.
LoadingRowGroup EventHandler<DataGridRowGroupHeaderEventArgs>
Occurs before a DataGridRowGroupHeader header is used.
LostFocus EventHandler<RoutedEventArgs>
Occurs when the control loses focus.
Inherited from InputElement
PointerEnter EventHandler<PointerEventArgs>
Occurs when the pointer enters the control.
Inherited from InputElement
PointerLeave EventHandler<PointerEventArgs>
Occurs when the pointer leaves the control.
Inherited from InputElement
PointerMoved EventHandler<PointerEventArgs>
Occurs when the pointer moves over the control.
Inherited from InputElement
PointerPressed EventHandler<PointerPressedEventArgs>
Occurs when the pointer is pressed over the control.
Inherited from InputElement
PointerReleased EventHandler<PointerReleasedEventArgs>
Occurs when the pointer is released over the control.
Inherited from InputElement
PointerWheelChanged EventHandler<PointerWheelEventArgs>
Occurs when the mouse wheen is scrolled over the control.
Inherited from InputElement
PreparingCellForEdit EventHandler<DataGridPreparingCellForEditEventArgs>
Occurs when a cell in a DataGridTemplateColumn enters editing mode.
PropertyChanged EventHandler<AvaloniaPropertyChangedEventArgs>
Raised when a AvaloniaProperty value changes on this object.
Inherited from AvaloniaObject
ResourcesChanged EventHandler<ResourcesChangedEventArgs>
Occurs when a resource in this styled element or a parent styled element has changed.
Inherited from StyledElement
RowDetailsVisibilityChanged EventHandler<DataGridRowDetailsEventArgs>
Occurs when the RowDetailsVisibilityMode property value changes.
RowEditEnded EventHandler<DataGridRowEditEndedEventArgs>
Occurs when the row has been successfully committed or cancelled.
RowEditEnding EventHandler<DataGridRowEditEndingEventArgs>
Occurs immediately before the row has been successfully committed or cancelled.
SelectionChanged EventHandler<SelectionChangedEventArgs>
Occurs when the SelectedItem or SelectedItems property value changes.
Tapped EventHandler<RoutedEventArgs>
Occurs when a tap gesture occurs on the control.
Inherited from InputElement
TemplateApplied EventHandler<TemplateAppliedEventArgs>
Raised when the control's template is applied.
Inherited from TemplatedControl
TextInput EventHandler<TextInputEventArgs>
Occurs when a user typed some text while the control has focus.
Inherited from InputElement
UnloadingRow EventHandler<DataGridRowEventArgs>
Occurs when a DataGridRow object becomes available for reuse.
UnloadingRowDetails EventHandler<DataGridRowDetailsEventArgs>
Occurs when a row details element becomes available for reuse.
UnloadingRowGroup EventHandler<DataGridRowGroupHeaderEventArgs>
Occurs when the DataGridRowGroupHeader is available for reuse.

Fields

Name Constant Value Summary
AlternatingRowBackgroundProperty
static
AreRowDetailsFrozenProperty
static
AreRowGroupHeadersFrozenProperty
static
AutoGenerateColumnsProperty
static
BackgroundProperty
Defines the Background property.
Inherited from TemplatedControl
static
BorderBrushProperty
Defines the BorderBrush property.
Inherited from TemplatedControl
static
BorderThicknessProperty
Defines the BorderThickness property.
Inherited from TemplatedControl
static
BoundsProperty
Defines the Bounds property.
Inherited from Visual
static
CanUserReorderColumnsProperty
Identifies the CanUserReorderColumns dependency property.
static
CanUserResizeColumnsProperty
Identifies the CanUserResizeColumns dependency property.
static
CanUserSortColumnsProperty
Identifies the CanUserSortColumns dependency property.
static
ClipboardCopyModeProperty
static
ClipProperty
Defines the Clip property.
Inherited from Visual
static
ClipToBoundsProperty
Defines the ClipToBounds property.
Inherited from Visual
static
ClockProperty
Inherited from Animatable
static
ColumnHeaderHeightProperty
Identifies the ColumnHeaderHeight dependency property.
static
ColumnWidthProperty
Identifies the ColumnWidth dependency property.
static
ContextMenuProperty
Defines the ContextMenu property.
Inherited from Control
static
CursorProperty
Gets or sets associated mouse cursor.
Inherited from InputElement
static
DataContextProperty
Defines the DataContext property.
Inherited from StyledElement
static
DesiredSizeProperty
Defines the DesiredSize property.
Inherited from Layoutable
static
DoubleTappedEvent
Defines the DoubleTapped event.
Inherited from InputElement
static
DropLocationIndicatorTemplateProperty
static
FocusableProperty
Defines the Focusable property.
Inherited from InputElement
static
FocusAdornerProperty
Defines the FocusAdorner property.
Inherited from Control
static
FontFamilyProperty
Defines the FontFamily property.
Inherited from TemplatedControl
static
FontSizeProperty
Defines the FontSize property.
Inherited from TemplatedControl
static
FontStyleProperty
Defines the FontStyle property.
Inherited from TemplatedControl
static
FontWeightProperty
Defines the FontWeight property.
Inherited from TemplatedControl
static
ForegroundProperty
Defines the Foreground property.
Inherited from TemplatedControl
static
FrozenColumnCountProperty
static
GotFocusEvent
Defines the GotFocus event.
Inherited from InputElement
static
GridLinesVisibilityProperty
static
HeadersVisibilityProperty
static
HeightProperty
Defines the Height property.
Inherited from Layoutable
static
HorizontalAlignmentProperty
Defines the HorizontalAlignment property.
Inherited from Layoutable
static
HorizontalGridLinesBrushProperty
static
HorizontalScrollBarVisibilityProperty
static
IsEnabledCoreProperty
Defines the IsEnabledCore property.
Inherited from InputElement
static
IsEnabledProperty
Defines the IsEnabled property.
Inherited from InputElement
static
IsFocusedProperty
Defines the IsFocused property.
Inherited from InputElement
static
IsHitTestVisibleProperty
Defines the IsHitTestVisible property.
Inherited from InputElement
static
IsPointerOverProperty
Defines the IsPointerOver property.
Inherited from InputElement
static
IsReadOnlyProperty
static
IsTemplateFocusTargetProperty
Defines the IsTemplateFocusTarget attached property.
Inherited from TemplatedControl
static
IsValidProperty
static
IsVisibleProperty
Defines the IsVisibleProperty property.
Inherited from Visual
static
ItemsProperty
Identifies the ItemsSource dependency property.
static
KeyDownEvent
Defines the KeyDown event.
Inherited from InputElement
static
KeyUpEvent
Defines the KeyUp event.
Inherited from InputElement
static
LostFocusEvent
Defines the LostFocus event.
Inherited from InputElement
static
MarginProperty
Defines the Margin property.
Inherited from Layoutable
static
MaxColumnWidthProperty
static
MaxHeightProperty
Defines the MaxHeight property.
Inherited from Layoutable
static
MaxWidthProperty
Defines the MaxWidth property.
Inherited from Layoutable
static
MinColumnWidthProperty
static
MinHeightProperty
Defines the MinHeight property.
Inherited from Layoutable
static
MinWidthProperty
Defines the MinWidth property.
Inherited from Layoutable
static
NameProperty
Defines the Name property.
Inherited from StyledElement
static
OpacityMaskProperty
Defines the OpacityMask property.
Inherited from Visual
static
OpacityProperty
Defines the Opacity property.
Inherited from Visual
static
PaddingProperty
Defines the Padding property.
Inherited from TemplatedControl
static
ParentProperty
Defines the Parent property.
Inherited from StyledElement
static
PointerEnterEvent
Defines the PointerEnter event.
Inherited from InputElement
static
PointerLeaveEvent
Defines the PointerLeave event.
Inherited from InputElement
static
PointerMovedEvent
Defines the PointerMoved event.
Inherited from InputElement
static
PointerPressedEvent
Defines the PointerPressed event.
Inherited from InputElement
static
PointerReleasedEvent
Defines the PointerReleased event.
Inherited from InputElement
static
PointerWheelChangedEvent
Defines the PointerWheelChanged event.
Inherited from InputElement
static
RenderTransformOriginProperty
Defines the RenderTransformOrigin property.
Inherited from Visual
static
RenderTransformProperty
Defines the RenderTransform property.
Inherited from Visual
static
RequestBringIntoViewEvent
Event raised when an element wishes to be scrolled into view.
Inherited from Control
static
RowBackgroundProperty
static
RowDetailsTemplateProperty
static
RowDetailsVisibilityModeProperty
static
RowHeaderWidthProperty
static
RowHeightProperty
static
SelectedIndexProperty
static
SelectedItemProperty
static
SelectionChangedEvent
static
SelectionModeProperty
static
TagProperty
Defines the Tag property.
Inherited from Control
static
TappedEvent
Defines the Tapped event.
Inherited from InputElement
static
TemplateAppliedEvent
Defines the TemplateApplied routed event.
Inherited from TemplatedControl
static
TemplatedParentProperty
Defines the TemplatedParent property.
Inherited from StyledElement
static
TemplateProperty
Defines the Template property.
Inherited from TemplatedControl
static
TextInputEvent
Defines the TextInput event.
Inherited from InputElement
static
TransformedBoundsProperty
Inherited from Visual
static
TransitionsProperty
Defines the Transitions property.
Inherited from Animatable
static
UseLayoutRoundingProperty
Defines the UseLayoutRoundingProperty property.
Inherited from Layoutable
static
VerticalAlignmentProperty
Defines the VerticalAlignment property.
Inherited from Layoutable
static
VerticalGridLinesBrushProperty
static
VerticalScrollBarVisibilityProperty
static
VisualParentProperty
Defines the VisualParent property.
Inherited from Visual
static
WidthProperty
Defines the Width property.
Inherited from Layoutable
static
ZIndexProperty
Defines the ZIndex property.
Inherited from Visual
static

Properties

Name Value Summary
AlternatingRowBackground IBrush
Gets or sets the System.Windows.Media.Brush that is used to paint the background of odd-numbered rows.
AreRowDetailsFrozen bool
Gets or sets a value that indicates whether the row details sections remain fixed at the width of the display area or can scroll horizontally.
AreRowGroupHeadersFrozen bool
Gets or sets a value that indicates whether the row group header sections remain fixed at the width of the display area or can scroll horizontally.
AutoGenerateColumns bool
Gets or sets a value that indicates whether columns are created automatically when the Avalonia.Controls.DataGrid.ItemsSource property is set.
Background IBrush
Gets or sets the brush used to draw the control's background.
Inherited from TemplatedControl
BorderBrush IBrush
Gets or sets the brush used to draw the control's border.
Inherited from TemplatedControl
BorderThickness Thickness
Gets or sets the thickness of the control's border.
Inherited from TemplatedControl
Bounds Rect
Gets the bounds of the control relative to its parent.
Inherited from Visual
CanUserReorderColumns bool
Gets or sets a value that indicates whether the user can change the column display order by dragging column headers with the mouse.
CanUserResizeColumns bool
Gets or sets a value that indicates whether the user can adjust column widths using the mouse.
CanUserSortColumns bool
Gets or sets a value that indicates whether the user can sort columns by clicking the column header.
Classes Classes
Gets or sets the styled element's classes.
Inherited from StyledElement
Clip Geometry
Gets or sets the geometry clip for this visual.
Inherited from Visual
ClipboardCopyMode DataGridClipboardCopyMode
The property which determines how DataGrid content is copied to the Clipboard.
ClipToBounds bool
Gets a value indicating whether the control should be clipped to its bounds.
Inherited from Visual
Clock IClock
Inherited from Animatable
ColumnHeaderHeight double
Gets or sets the height of the column headers row.
Columns ObservableCollection<DataGridColumn>
Gets a collection that contains all the columns in the control.
ColumnWidth DataGridLength
Gets or sets the standard width or automatic sizing mode of columns in the control.
ContextMenu ContextMenu
Gets or sets a context menu to the control.
Inherited from Control
CurrentColumn DataGridColumn
Gets or sets the column that contains the current cell.
CurrentItem object
Gets the data item bound to the row that contains the current cell.
Cursor Cursor
Gets or sets associated mouse cursor.
Inherited from InputElement
DataContext object
Gets or sets the control's data context.
Inherited from StyledElement
DataTemplates DataTemplates
Gets or sets the data templates for the control.
Inherited from Control
DesiredSize Size
Gets the size that this element computed during the measure pass of the layout process.
Inherited from Layoutable
DropLocationIndicatorTemplate ITemplate<IControl>
Gets or sets the template that is used when rendering the column headers.
Focusable bool
Gets or sets a value indicating whether the control can receive focus.
Inherited from InputElement
FocusAdorner ITemplate<IControl>
Gets or sets the control's focus adorner.
Inherited from Control
FontFamily FontFamily
Gets or sets the font family used to draw the control's text.
Inherited from TemplatedControl
FontSize double
Gets or sets the size of the control's text in points.
Inherited from TemplatedControl
FontStyle FontStyle
Gets or sets the font style used to draw the control's text.
Inherited from TemplatedControl
FontWeight FontWeight
Gets or sets the font weight used to draw the control's text.
Inherited from TemplatedControl
Foreground IBrush
Gets or sets the brush used to draw the control's text and other foreground elements.
Inherited from TemplatedControl
FrozenColumnCount int
Gets or sets the number of columns that the user cannot scroll horizontally.
GridLinesVisibility DataGridGridLinesVisibility
Gets or sets a value that indicates which grid lines separating inner cells are shown.
HeadersVisibility DataGridHeadersVisibility
Gets or sets a value that indicates the visibility of row and column headers.
Height double
Gets or sets the height of the element.
Inherited from Layoutable
HorizontalAlignment HorizontalAlignment
Gets or sets the element's preferred horizontal alignment in its parent.
Inherited from Layoutable
HorizontalGridLinesBrush IBrush
Gets or sets the System.Windows.Media.Brush that is used to paint grid lines separating rows.
HorizontalScrollBarVisibility ScrollBarVisibility
Gets or sets a value that indicates how the horizontal scroll bar is displayed.
InheritanceParent IAvaloniaObject
Gets or sets the parent object that inherited AvaloniaProperty values are inherited from.
Inherited from AvaloniaObject
IsArrangeValid bool
Gets a value indicating whether the control's layouts arrange is valid.
Inherited from Layoutable
IsEffectivelyVisible bool
Gets a value indicating whether this control and all its parents are visible.
Inherited from Visual
IsEnabled bool
Gets or sets a value indicating whether the control is enabled for user interaction.
Inherited from InputElement
IsEnabledCore bool
Gets a value indicating whether the control is effectively enabled for user interaction.
Inherited from InputElement
IsFocused bool
Gets or sets a value indicating whether the control is focused.
Inherited from InputElement
IsHitTestVisible bool
Gets or sets a value indicating whether the control is considered for hit testing.
Inherited from InputElement
IsInitialized bool
Gets a value that indicates whether the element has finished initialization.
Inherited from StyledElement
IsMeasureValid bool
Gets a value indicating whether the control's layout measure is valid.
Inherited from Layoutable
IsPointerOver bool
Gets or sets a value indicating whether the pointer is currently over the control.
Inherited from InputElement
IsReadOnly bool
Gets or sets a value that indicates whether the user can edit the values in the control.
IsValid bool
IsVisible bool
Gets a value indicating whether this control is visible.
Inherited from Visual
Items IEnumerable
Gets or sets a collection that is used to generate the content of the control.
KeyBindings List<KeyBinding>
Inherited from InputElement
LogicalChildren IAvaloniaList<ILogical>
Gets the styled element's logical children.
Inherited from StyledElement
Margin Thickness
Gets or sets the margin around the element.
Inherited from Layoutable
MaxColumnWidth double
Gets or sets the maximum width of columns in the DataGrid .
MaxHeight double
Gets or sets the maximum height of the element.
Inherited from Layoutable
MaxWidth double
Gets or sets the maximum width of the element.
Inherited from Layoutable
MinColumnWidth double
Gets or sets the minimum width of columns in the DataGrid.
MinHeight double
Gets or sets the minimum height of the element.
Inherited from Layoutable
MinWidth double
Gets or sets the minimum width of the element.
Inherited from Layoutable
Name string
Gets or sets the name of the styled element.
Inherited from StyledElement
Opacity double
Gets the opacity of the control.
Inherited from Visual
OpacityMask IBrush
Gets the opacity mask of the control.
Inherited from Visual
Padding Thickness
Gets or sets the padding placed between the border of the control and its content.
Inherited from TemplatedControl
Parent IControl
Inherited from Control
Parent IStyledElement
Gets the styled element's logical parent.
Inherited from StyledElement
PseudoClasses IPseudoClasses
Gets the Classes collection in a form that allows adding and removing pseudoclasses.
Inherited from StyledElement
RenderTransform Transform
Gets the render transform of the control.
Inherited from Visual
RenderTransformOrigin RelativePoint
Gets the transform origin of the control.
Inherited from Visual
Resources IResourceDictionary
Gets or sets the styled element's resource dictionary.
Inherited from StyledElement
RowBackground IBrush
Gets or sets the System.Windows.Media.Brush that is used to paint row backgrounds.
RowDetailsTemplate IDataTemplate
Gets or sets the template that is used to display the content of the details section of rows.
RowDetailsVisibilityMode DataGridRowDetailsVisibilityMode
Gets or sets a value that indicates when the details sections of rows are displayed.
RowHeaderWidth double
Gets or sets the width of the row header column.
RowHeight double
Gets or sets the standard height of rows in the control.
SelectedIndex int
Gets or sets the index of the current selection.
SelectedItem object
Gets or sets the data item corresponding to the selected row.
SelectedItems IList
Gets a list that contains the data items corresponding to the selected rows.
SelectionMode DataGridSelectionMode
Gets or sets the selection behavior of the data grid.
Styles Styles
Gets the styles for the styled element.
Inherited from StyledElement
Tag object
Gets or sets a user-defined object attached to the control.
Inherited from Control
Template IControlTemplate
Gets or sets the template that defines the control's appearance.
Inherited from TemplatedControl
TemplatedParent ITemplatedControl
Gets the styled element whose lookless template this styled element is part of.
Inherited from StyledElement
this[AvaloniaProperty] object
Gets or sets the value of a AvaloniaProperty.
Inherited from AvaloniaObject
this[IndexerDescriptor] IBinding
Gets or sets a binding for a AvaloniaProperty.
Inherited from AvaloniaObject
TransformedBounds TransformedBounds?
Gets the bounds of the control relative to the window, accounting for rendering transforms.
Inherited from Visual
Transitions Transitions
Gets or sets the property transitions for the control.
Inherited from Animatable
UseLayoutRounding bool
Gets or sets a value that determines whether the element should be snapped to pixel boundaries at layout time.
Inherited from Layoutable
VerticalAlignment VerticalAlignment
Gets or sets the element's preferred vertical alignment in its parent.
Inherited from Layoutable
VerticalGridLinesBrush IBrush
Gets or sets the System.Windows.Media.Brush that is used to paint grid lines separating columns.
VerticalScrollBarVisibility ScrollBarVisibility
Gets or sets a value that indicates how the vertical scroll bar is displayed.
VisualChildren IAvaloniaList<IVisual>
Gets the control's child visuals.
Inherited from Visual
VisualRoot IRenderRoot
Gets the root of the visual tree, if the control is attached to a visual tree.
Inherited from Visual
Width double
Gets or sets the width of the element.
Inherited from Layoutable
ZIndex int
Gets the Z index of the control.
Inherited from Visual

Methods

Name Value Summary
AddHandler(RoutedEvent, Delegate, RoutingStrategies, bool) IDisposable
Adds a handler for the specified routed event.
Inherited from Interactive
AddHandler<TEventArgs>(RoutedEvent<TEventArgs>, EventHandler<TEventArgs>, RoutingStrategies, bool) IDisposable
Adds a handler for the specified routed event.
Inherited from Interactive
AffectsArrange(AvaloniaProperty[]) void
Marks a property as affecting the control's arrangement.
Inherited from Layoutable
static
AffectsArrange<T>(AvaloniaProperty[]) void
Marks a property as affecting the control's arrangement.
Inherited from Layoutable
static
AffectsMeasure(AvaloniaProperty[]) void
Marks a property as affecting the control's measurement.
Inherited from Layoutable
static
AffectsMeasure<T>(AvaloniaProperty[]) void
Marks a property as affecting the control's measurement.
Inherited from Layoutable
static
AffectsRender(AvaloniaProperty[]) void
Indicates that a property change should cause InvalidateVisual() to be called.
Inherited from Visual
static
AffectsRender<T>(AvaloniaProperty[]) void
Indicates that a property change should cause InvalidateVisual() to be called.
Inherited from Visual
static
AffectsValidation(AvaloniaProperty, AvaloniaProperty[]) void
Forces revalidation of properties when a property value changes.
Inherited from AvaloniaObject
static
ApplyTemplate() void
Creates the visual children of the control, if necessary
Inherited from TemplatedControl
Arrange(Rect) void
Arranges the control and its children.
Inherited from Layoutable
ArrangeCore(Rect) void
The default implementation of the control's arrange pass.
Inherited from Layoutable
ArrangeOverride(Size) Size
Arranges the content of the DataGridRow.
BeginEdit() bool
Enters editing mode for the current cell and current row (if they're not already in editing mode).
BeginEdit(RoutedEventArgs) bool
Enters editing mode for the current cell and current row (if they're not already in editing mode).
BeginInit() void
Inherited from StyledElement
Bind(AvaloniaProperty, IObservable<object>, BindingPriority) IDisposable
Binds a AvaloniaProperty to an observable.
Inherited from AvaloniaObject
Bind<T>(AvaloniaProperty<T>, IObservable<T>, BindingPriority) IDisposable
Binds a AvaloniaProperty to an observable.
Inherited from AvaloniaObject
CancelEdit() bool
Cancels editing mode and restores the original value.
CancelEdit(DataGridEditingUnit) bool
Cancels editing mode for the specified DataGridEditingUnit and restores its original value.
CheckAccess() bool
Inherited from AvaloniaObject
ClearValue(AvaloniaProperty) void
Clears a AvaloniaProperty's local value.
Inherited from AvaloniaObject
CollapseRowGroup(DataGridCollectionViewGroup, bool) void
Collapses the DataGridRowGroupHeader that represents a given CollectionViewGroup
CommitEdit() bool
Commits editing mode and pushes changes to the backend.
CommitEdit(DataGridEditingUnit, bool) bool
Commits editing mode for the specified DataGridEditingUnit and pushes changes to the backend.
EndInit() void
Inherited from StyledElement
ExpandRowGroup(DataGridCollectionViewGroup, bool) void
Expands the DataGridRowGroupHeader that represents a given CollectionViewGroup
Focus() void
Focuses the control.
Inherited from InputElement
GetGroupFromItem(object, int) DataGridCollectionViewGroup
Returns the Group at the indicated level or null if the item is not in the ItemsSource
GetIsTemplateFocusTarget(Control) bool
Gets the value of the IsTemplateFocusTargetProperty attached property on a control.
Inherited from TemplatedControl
static
GetTemplateFocusTarget() IControl
Gets the element that receives the focus adorner.
Inherited from TemplatedControl
GetValue(AvaloniaProperty) object
Gets a AvaloniaProperty value.
Inherited from AvaloniaObject
GetValue<T>(AvaloniaProperty<T>) T
Gets a AvaloniaProperty value.
Inherited from AvaloniaObject
InitializeIfNeeded() void
Inherited from StyledElement
InvalidateArrange() void
Invalidates the arrangement of the control and queues a new layout pass.
Inherited from Layoutable
InvalidateMeasure() void
Invalidates the measurement of the control and queues a new layout pass.
Inherited from Layoutable
InvalidateVisual() void
Invalidates the visual and queues a repaint.
Inherited from Visual
IsAnimating(AvaloniaProperty) bool
Checks whether a AvaloniaProperty is animating.
Inherited from AvaloniaObject
IsSet(AvaloniaProperty) bool
Checks whether a AvaloniaProperty is set on this object.
Inherited from AvaloniaObject
LogBindingError(AvaloniaProperty, Exception) void
Inherited from Visual
Measure(Size) void
Carries out a measure of the control.
Inherited from Layoutable
MeasureCore(Size) Size
The default implementation of the control's measure pass.
Inherited from Layoutable
MeasureOverride(Size) Size
Measures the children of a DataGridRow to prepare for arranging them during the Avalonia.Controls.DataGridRow.ArrangeOverride(System.Windows.Size) pass.
OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs) void
Called when the styled element is added to a rooted logical tree.
Inherited from TemplatedControl
OnAttachedToVisualTree(VisualTreeAttachmentEventArgs) void
Called when the control is added to a visual tree.
Inherited from Visual
OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs) void
Inherited from Control
OnAutoGeneratingColumn(DataGridAutoGeneratingColumnEventArgs) void
Raises the AutoGeneratingColumn event.
OnBeginningEdit(DataGridBeginningEditEventArgs) void
Raises the BeginningEdit event.
OnCellEditEnded(DataGridCellEditEndedEventArgs) void
Raises the CellEditEnded event.
OnCellEditEnding(DataGridCellEditEndingEventArgs) void
Raises the CellEditEnding event.
OnColumnDisplayIndexChanged(DataGridColumnEventArgs) void
OnCopyingRowClipboardContent(DataGridRowClipboardEventArgs) void
This method raises the CopyingRowClipboardContent event.
OnCurrentCellChanged(EventArgs) void
Raises the CurrentCellChanged event.
OnDataContextBeginUpdate() void
Called when the DataContext begins updating.
Inherited from StyledElement
OnDataContextChanged(EventArgs) void
Called when the DataContext property changes.
Inherited from StyledElement
OnDataContextEndUpdate() void
Called when the DataContext finishes updating.
Inherited from StyledElement
OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs) void
Called when the styled element is removed from a rooted logical tree.
Inherited from TemplatedControl
OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs) void
Called when the control is removed from a visual tree.
Inherited from Visual
OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs) void
Inherited from Control
OnGotFocus(GotFocusEventArgs) void
Called before the GotFocus event occurs.
Inherited from Control
OnKeyDown(KeyEventArgs) void
Called before the KeyDown event occurs.
Inherited from InputElement
OnKeyUp(KeyEventArgs) void
Called before the KeyUp event occurs.
Inherited from InputElement
OnLoadingRow(DataGridRowEventArgs) void
Raises the LoadingRow event for row preparation.
OnLoadingRowDetails(DataGridRowDetailsEventArgs) void
Raises the LoadingRowDetails for row details preparation
OnLoadingRowGroup(DataGridRowGroupHeaderEventArgs) void
Raises the LoadingRowGroup event
OnLostFocus(RoutedEventArgs) void
Called before the LostFocus event occurs.
Inherited from Control
OnMeasureInvalidated() void
Called by InvalidateMeasure
Inherited from Layoutable
OnPointerEnter(PointerEventArgs) void
Called before the PointerEnter event occurs.
Inherited from InputElement
OnPointerLeave(PointerEventArgs) void
Called before the PointerLeave event occurs.
Inherited from InputElement
OnPointerMoved(PointerEventArgs) void
Called before the PointerMoved event occurs.
Inherited from InputElement
OnPointerPressed(PointerPressedEventArgs) void
Called before the PointerPressed event occurs.
Inherited from InputElement
OnPointerReleased(PointerReleasedEventArgs) void
Called before the PointerReleased event occurs.
Inherited from InputElement
OnPointerWheelChanged(PointerWheelEventArgs) void
Scrolls the DataGrid according to the direction of the delta.
OnPreparingCellForEdit(DataGridPreparingCellForEditEventArgs) void
Raises the PreparingCellForEdit event.
OnPropertyChanged(AvaloniaPropertyChangedEventArgs) void
Reacts to a change in a AvaloniaProperty value in order to animate the change if a ITransition is set for the property.
Inherited from Animatable
OnRowEditEnded(DataGridRowEditEndedEventArgs) void
Raises the RowEditEnded event.
OnRowEditEnding(DataGridRowEditEndingEventArgs) void
Raises the RowEditEnding event.
OnSelectionChanged(SelectionChangedEventArgs) void
Raises the SelectionChanged event and clears the _selectionChanged. This event won't get raised again until after _selectionChanged is set back to true.
OnTemplateApplied(TemplateAppliedEventArgs) void
Builds the visual tree for the column header when a new template is applied.
OnTemplateChanged(AvaloniaPropertyChangedEventArgs) void
Called when the Template property changes.
Inherited from TemplatedControl
OnTextInput(TextInputEventArgs) void
Called before the TextInput event occurs.
Inherited from InputElement
OnUnloadingRow(DataGridRowEventArgs) void
Raises the UnloadingRow event for row recycling.
OnUnloadingRowDetails(DataGridRowDetailsEventArgs) void
Raises the UnloadingRowDetails event
OnUnloadingRowGroup(DataGridRowGroupHeaderEventArgs) void
Raises the UnLoadingRowGroup event
OnVisualParentChanged(IVisual, IVisual) void
Called when the control's visual parent changes.
Inherited from Layoutable
PseudoClass(AvaloniaProperty<bool>, string) void
Adds a pseudo-class to be set when a property is true.
Inherited from StyledElement
static
PseudoClass<TOwner, TProperty>(AvaloniaProperty<TProperty>, Func<TProperty, bool>, string) void
Adds a pseudo-class to be set when a property equals a certain value.
Inherited from StyledElement
static
PseudoClass<TOwner>(AvaloniaProperty<bool>, string) void
Adds a pseudo-class to be set when a property is true.
Inherited from StyledElement
static
PseudoClass<TProperty>(AvaloniaProperty<TProperty>, Func<TProperty, bool>, string) void
Adds a pseudo-class to be set when a property equals a certain value.
Inherited from StyledElement
static
RaiseEvent(RoutedEventArgs) void
Raises a routed event.
Inherited from Interactive
RaisePropertyChanged(AvaloniaProperty, object, object, BindingPriority) void
Raises the PropertyChanged event.
Inherited from AvaloniaObject
RemoveHandler(RoutedEvent, Delegate) void
Removes a handler for the specified routed event.
Inherited from Interactive
RemoveHandler<TEventArgs>(RoutedEvent<TEventArgs>, EventHandler<TEventArgs>) void
Removes a handler for the specified routed event.
Inherited from Interactive
Render(DrawingContext) void
Renders the visual to a DrawingContext.
Inherited from Visual
Revalidate(AvaloniaProperty) void
Forces the specified property to be revalidated.
Inherited from AvaloniaObject
ScrollIntoView(object, DataGridColumn) void
Scrolls the specified item or RowGroupHeader and/or column into view. If item is not null: scrolls the row representing the item into view; If column is not null: scrolls the column into view; If both item and column are null, the method returns without scrolling.
SetAndRaise<T>(AvaloniaProperty<T>, T, AvaloniaObject.SetAndRaiseCallback<T>, T) bool
Sets the backing field for a direct avalonia property, raising the PropertyChanged event if the value has changed.
Inherited from AvaloniaObject
SetAndRaise<T>(AvaloniaProperty<T>, T, T) bool
Sets the backing field for a direct avalonia property, raising the PropertyChanged event if the value has changed.
Inherited from AvaloniaObject
SetIsTemplateFocusTarget(Control, bool) void
Sets the value of the IsTemplateFocusTargetProperty attached property on a control.
Inherited from TemplatedControl
static
SetValue(AvaloniaProperty, object, BindingPriority) void
Sets a AvaloniaProperty value.
Inherited from AvaloniaObject
SetValue<T>(AvaloniaProperty<T>, T, BindingPriority) void
Sets a AvaloniaProperty value.
Inherited from AvaloniaObject
TransformToVisual(IVisual) Matrix?
Returns a transform that transforms the visual's coordinates into the coordinates of the specified visual.
Inherited from Visual
UpdateDataValidation(AvaloniaProperty, BindingNotification) void
Called to update the validation state for properties for which data validation is enabled.
Inherited from AvaloniaObject
VerifyAccess() void
Inherited from AvaloniaObject

Extension Methods

Name Value Summary
Bind(AvaloniaProperty, IBinding, object) IDisposable
Binds a property on an IAvaloniaObject to an IBinding.
BringIntoView() void
Tries to bring the control into view.
BringIntoView(Rect) void
Tries to bring the control into view.
CalculateDistanceFromAncestor(IVisual) int
Calculates the distance from a visual's IRenderRoot.
FindCommonVisualAncestor(IVisual) IVisual
Tries to get the first common ancestor of two visuals.
FindControl<T>(string) T
Finds the named control in the scope of the specified control.
FindDataTemplate(object, IDataTemplate) IDataTemplate
Find a data template that matches a piece of data.
FindNameScope() INameScope
FindResource(string) object
Finds the specified resource by searching up the logical tree and then global styles.
GetDiagnostic(AvaloniaProperty) AvaloniaPropertyValue
Gets a diagnostic for a AvaloniaProperty on a AvaloniaObject.
GetInputElementsAt(Point) IEnumerable<IInputElement>
Returns the active input elements at a point on an IInputElement.
GetLogicalAncestors() IEnumerable<ILogical>
GetLogicalChildren() IEnumerable<ILogical>
GetLogicalDescendants() IEnumerable<ILogical>
GetLogicalParent() ILogical
GetLogicalParent<T>() T
GetLogicalSiblings() IEnumerable<ILogical>
GetObservable(AvaloniaProperty) IObservable<object>
Gets an observable for a AvaloniaProperty.
GetObservable<T>(AvaloniaProperty<T>) IObservable<T>
Gets an observable for a AvaloniaProperty.
GetObservable<TEventArgs>(RoutedEvent<TEventArgs>, RoutingStrategies, bool) IObservable<TEventArgs>
Gets an observable for a RoutedEvent<TEventArgs>.
GetPropertyChangedObservable(AvaloniaProperty) IObservable<AvaloniaPropertyChangedEventArgs>
Gets an observable that listens for property changed events for an AvaloniaProperty.
GetResourceObservable(string) IObservable<object>
GetSelfAndLogicalAncestors() IEnumerable<ILogical>
GetSelfAndLogicalDescendants() IEnumerable<ILogical>
GetSelfAndVisualAncestors() IEnumerable<IVisual>
Enumerates an IVisual and its ancestors in the visual tree.
GetSelfAndVisualDescendants() IEnumerable<IVisual>
Enumerates an IVisual and its descendants in the visual tree.
GetSubject(AvaloniaProperty, BindingPriority) ISubject<object>
Gets a subject for a AvaloniaProperty.
GetSubject<T>(AvaloniaProperty<T>, BindingPriority) ISubject<T>
Gets a subject for a AvaloniaProperty.
GetTemplateChildren() IEnumerable<IControl>
GetVisualAncestors() IEnumerable<IVisual>
Enumerates the ancestors of an IVisual in the visual tree.
GetVisualAt(Point) IVisual
Gets the first visual in the visual tree whose bounds contain a point.
GetVisualChildren() IEnumerable<IVisual>
Enumerates the children of an IVisual in the visual tree.
GetVisualDescendants() IEnumerable<IVisual>
Enumerates the descendants of an IVisual in the visual tree.
GetVisualParent() IVisual
Gets the visual parent of an IVisual.
GetVisualParent<T>() T
Gets the visual parent of an IVisual.
GetVisualRoot() IRenderRoot
Gets the root visual for an IVisual.
GetVisualsAt(Point) IEnumerable<IVisual>
Enumerates the visible visuals in the visual tree whose bounds contain a point.
GetVisualsAt(Point, Func<IVisual, bool>) IEnumerable<IVisual>
Enumerates the visuals in the visual tree whose bounds contain a point.
InputHitTest(Point) IInputElement
Returns the topmost active input element at a point on an IInputElement.
IsLogicalParentOf(ILogical) bool
IsVisualAncestorOf(IVisual) bool
Tests whether an IVisual is an ancestor of another visual.
PointToClient(PixelPoint) Point
Converts a point from screen to client coordinates.
PointToScreen(Point) PixelPoint
Converts a point from client to screen coordinates.
TranslatePoint(Point, IVisual) Point
Translates a point relative to this visual to coordinates that are relative to the specified visual. The visual and relativeTo should be descendants of the same root window
TryFindResource(string, object) bool
Tries to the specified resource by searching up the logical tree and then global styles.