Show / Hide Table of Contents

Class DataGrid

DataGrid class that provides logic to restrict the selection to a maximum number of items. Furthermore, the class provides two string properties that can be used to set the headers of the SelectionOverlay to replace/show/hide columns This DataGrid can group it's columns in several rows. You can set the maximum stacked rows with MaxHeaderStackCount. The user can drag and drop row headers to group them in rows. Up to the aforementioned maximum.

Inheritance
object
DispatcherObject
DependencyObject
Visual
UIElement
FrameworkElement
Control
ItemsControl
Selector
MultiSelector
DataGrid
DataGrid
MetaDataGrid
SearchableDataGrid
Implements
IAnimatable
ISupportInitialize
IFrameworkInputElement
IInputElement
IQueryAmbient
IContainItemStorage
IAddChild
DataGrid.AlternatingRowBackgroundProperty
DataGrid.AreRowDetailsFrozenProperty
DataGrid.AutoGenerateColumnsProperty
DataGrid.BeginEditCommand
DataGrid.CancelEditCommand
DataGrid.CanUserAddRowsProperty
DataGrid.CanUserDeleteRowsProperty
DataGrid.CanUserReorderColumnsProperty
DataGrid.CanUserResizeColumnsProperty
DataGrid.CanUserResizeRowsProperty
DataGrid.CanUserSortColumnsProperty
DataGrid.CellsPanelHorizontalOffsetProperty
DataGrid.CellStyleProperty
DataGrid.ClipboardCopyModeProperty
DataGrid.ColumnHeaderHeightProperty
DataGrid.ColumnHeaderStyleProperty
DataGrid.ColumnWidthProperty
DataGrid.CommitEditCommand
DataGrid.CurrentCellProperty
DataGrid.CurrentColumnProperty
DataGrid.CurrentItemProperty
DataGrid.DragIndicatorStyleProperty
DataGrid.DropLocationIndicatorStyleProperty
DataGrid.EnableColumnVirtualizationProperty
DataGrid.EnableRowVirtualizationProperty
DataGrid.FrozenColumnCountProperty
DataGrid.GridLinesVisibilityProperty
DataGrid.HeadersVisibilityProperty
DataGrid.HorizontalGridLinesBrushProperty
DataGrid.HorizontalScrollBarVisibilityProperty
DataGrid.IsReadOnlyProperty
DataGrid.MaxColumnWidthProperty
DataGrid.MinColumnWidthProperty
DataGrid.MinRowHeightProperty
DataGrid.NewItemMarginProperty
DataGrid.NonFrozenColumnsViewportHorizontalOffsetProperty
DataGrid.RowBackgroundProperty
DataGrid.RowDetailsTemplateProperty
DataGrid.RowDetailsTemplateSelectorProperty
DataGrid.RowDetailsVisibilityModeProperty
DataGrid.RowHeaderActualWidthProperty
DataGrid.RowHeaderStyleProperty
DataGrid.RowHeaderTemplateProperty
DataGrid.RowHeaderTemplateSelectorProperty
DataGrid.RowHeaderWidthProperty
DataGrid.RowHeightProperty
DataGrid.RowStyleProperty
DataGrid.RowStyleSelectorProperty
DataGrid.RowValidationErrorTemplateProperty
DataGrid.SelectionModeProperty
DataGrid.SelectionUnitProperty
DataGrid.VerticalGridLinesBrushProperty
DataGrid.VerticalScrollBarVisibilityProperty
DataGrid.BeginEdit()
DataGrid.BeginEdit(RoutedEventArgs)
DataGrid.CancelEdit()
DataGrid.CancelEdit(DataGridEditingUnit)
DataGrid.ClearContainerForItemOverride(DependencyObject, object)
DataGrid.ClearDetailsVisibilityForItem(object)
DataGrid.ColumnFromDisplayIndex(int)
DataGrid.CommitEdit()
DataGrid.CommitEdit(DataGridEditingUnit, bool)
DataGrid.GenerateColumns(IItemProperties)
DataGrid.GetDetailsVisibilityForItem(object)
DataGrid.MeasureOverride(Size)
DataGrid.OnAddingNewItem(AddingNewItemEventArgs)
DataGrid.OnAutoGeneratedColumns(EventArgs)
DataGrid.OnAutoGeneratingColumn(DataGridAutoGeneratingColumnEventArgs)
DataGrid.OnBeginningEdit(DataGridBeginningEditEventArgs)
DataGrid.OnCanExecuteBeginEdit(CanExecuteRoutedEventArgs)
DataGrid.OnCanExecuteCancelEdit(CanExecuteRoutedEventArgs)
DataGrid.OnCanExecuteCommitEdit(CanExecuteRoutedEventArgs)
DataGrid.OnCanExecuteCopy(CanExecuteRoutedEventArgs)
DataGrid.OnCanExecuteDelete(CanExecuteRoutedEventArgs)
DataGrid.OnCellEditEnding(DataGridCellEditEndingEventArgs)
DataGrid.OnColumnDisplayIndexChanged(DataGridColumnEventArgs)
DataGrid.OnContextMenuOpening(ContextMenuEventArgs)
DataGrid.OnCopyingRowClipboardContent(DataGridRowClipboardEventArgs)
DataGrid.OnCreateAutomationPeer()
DataGrid.OnExecutedBeginEdit(ExecutedRoutedEventArgs)
DataGrid.OnExecutedCancelEdit(ExecutedRoutedEventArgs)
DataGrid.OnExecutedCommitEdit(ExecutedRoutedEventArgs)
DataGrid.OnExecutedCopy(ExecutedRoutedEventArgs)
DataGrid.OnExecutedDelete(ExecutedRoutedEventArgs)
DataGrid.OnInitializingNewItem(InitializingNewItemEventArgs)
DataGrid.OnIsMouseCapturedChanged(DependencyPropertyChangedEventArgs)
DataGrid.OnItemsChanged(NotifyCollectionChangedEventArgs)
DataGrid.OnLoadingRow(DataGridRowEventArgs)
DataGrid.OnLoadingRowDetails(DataGridRowDetailsEventArgs)
DataGrid.OnMouseMove(MouseEventArgs)
DataGrid.OnPreparingCellForEdit(DataGridPreparingCellForEditEventArgs)
DataGrid.OnRowDetailsVisibilityChanged(DataGridRowDetailsEventArgs)
DataGrid.OnRowEditEnding(DataGridRowEditEndingEventArgs)
DataGrid.OnSelectedCellsChanged(SelectedCellsChangedEventArgs)
DataGrid.OnSelectionChanged(SelectionChangedEventArgs)
DataGrid.OnTemplateChanged(ControlTemplate, ControlTemplate)
DataGrid.OnTextInput(TextCompositionEventArgs)
DataGrid.OnUnloadingRow(DataGridRowEventArgs)
DataGrid.OnUnloadingRowDetails(DataGridRowDetailsEventArgs)
DataGrid.PrepareContainerForItemOverride(DependencyObject, object)
DataGrid.ScrollIntoView(object)
DataGrid.ScrollIntoView(object, DataGridColumn)
DataGrid.SelectAllCells()
DataGrid.SetDetailsVisibilityForItem(object, Visibility)
DataGrid.UnselectAllCells()
DataGrid.AlternatingRowBackground
DataGrid.AreRowDetailsFrozen
DataGrid.AutoGenerateColumns
DataGrid.CanUserAddRows
DataGrid.CanUserDeleteRows
DataGrid.CanUserReorderColumns
DataGrid.CanUserResizeColumns
DataGrid.CanUserResizeRows
DataGrid.CanUserSortColumns
DataGrid.CellsPanelHorizontalOffset
DataGrid.CellStyle
DataGrid.ClipboardCopyMode
DataGrid.ColumnHeaderHeight
DataGrid.ColumnHeaderStyle
DataGrid.Columns
DataGrid.ColumnWidth
DataGrid.CurrentCell
DataGrid.CurrentColumn
DataGrid.CurrentItem
DataGrid.DeleteCommand
DataGrid.DragIndicatorStyle
DataGrid.DropLocationIndicatorStyle
DataGrid.EnableColumnVirtualization
DataGrid.EnableRowVirtualization
DataGrid.FocusBorderBrushKey
DataGrid.FrozenColumnCount
DataGrid.GridLinesVisibility
DataGrid.HandlesScrolling
DataGrid.HeadersVisibility
DataGrid.HeadersVisibilityConverter
DataGrid.HorizontalGridLinesBrush
DataGrid.HorizontalScrollBarVisibility
DataGrid.IsReadOnly
DataGrid.MaxColumnWidth
DataGrid.MinColumnWidth
DataGrid.MinRowHeight
DataGrid.NewItemMargin
DataGrid.NonFrozenColumnsViewportHorizontalOffset
DataGrid.RowBackground
DataGrid.RowDetailsScrollingConverter
DataGrid.RowDetailsTemplate
DataGrid.RowDetailsTemplateSelector
DataGrid.RowDetailsVisibilityMode
DataGrid.RowHeaderActualWidth
DataGrid.RowHeaderStyle
DataGrid.RowHeaderTemplate
DataGrid.RowHeaderTemplateSelector
DataGrid.RowHeaderWidth
DataGrid.RowHeight
DataGrid.RowStyle
DataGrid.RowStyleSelector
DataGrid.RowValidationErrorTemplate
DataGrid.RowValidationRules
DataGrid.SelectAllCommand
DataGrid.SelectedCells
DataGrid.SelectionMode
DataGrid.SelectionUnit
DataGrid.VerticalGridLinesBrush
DataGrid.VerticalScrollBarVisibility
DataGrid.AddingNewItem
DataGrid.AutoGeneratedColumns
DataGrid.AutoGeneratingColumn
DataGrid.BeginningEdit
DataGrid.CellEditEnding
DataGrid.ColumnDisplayIndexChanged
DataGrid.ColumnHeaderDragCompleted
DataGrid.ColumnHeaderDragDelta
DataGrid.ColumnHeaderDragStarted
DataGrid.ColumnReordered
DataGrid.ColumnReordering
DataGrid.CopyingRowClipboardContent
DataGrid.CurrentCellChanged
DataGrid.InitializingNewItem
DataGrid.LoadingRow
DataGrid.LoadingRowDetails
DataGrid.PreparingCellForEdit
DataGrid.RowDetailsVisibilityChanged
DataGrid.RowEditEnding
DataGrid.SelectedCellsChanged
DataGrid.Sorting
DataGrid.UnloadingRow
DataGrid.UnloadingRowDetails
MultiSelector.BeginUpdateSelectedItems()
MultiSelector.EndUpdateSelectedItems()
MultiSelector.SelectAll()
MultiSelector.UnselectAll()
MultiSelector.CanSelectMultipleItems
MultiSelector.IsUpdatingSelectedItems
MultiSelector.SelectedItems
Selector.IsSelectedProperty
Selector.IsSelectionActiveProperty
Selector.IsSynchronizedWithCurrentItemProperty
Selector.SelectedEvent
Selector.SelectedIndexProperty
Selector.SelectedItemProperty
Selector.SelectedValuePathProperty
Selector.SelectedValueProperty
Selector.SelectionChangedEvent
Selector.UnselectedEvent
Selector.AddSelectedHandler(DependencyObject, RoutedEventHandler)
Selector.AddUnselectedHandler(DependencyObject, RoutedEventHandler)
Selector.GetIsSelected(DependencyObject)
Selector.GetIsSelectionActive(DependencyObject)
Selector.OnInitialized(EventArgs)
Selector.RemoveSelectedHandler(DependencyObject, RoutedEventHandler)
Selector.RemoveUnselectedHandler(DependencyObject, RoutedEventHandler)
Selector.SetIsSelected(DependencyObject, bool)
Selector.IsSynchronizedWithCurrentItem
Selector.SelectedIndex
Selector.SelectedItem
Selector.SelectedValue
Selector.SelectedValuePath
Selector.SelectionChanged
ItemsControl.AlternationCountProperty
ItemsControl.AlternationIndexProperty
ItemsControl.DisplayMemberPathProperty
ItemsControl.GroupStyleSelectorProperty
ItemsControl.HasItemsProperty
ItemsControl.IsGroupingProperty
ItemsControl.IsTextSearchCaseSensitiveProperty
ItemsControl.IsTextSearchEnabledProperty
ItemsControl.ItemBindingGroupProperty
ItemsControl.ItemContainerStyleProperty
ItemsControl.ItemContainerStyleSelectorProperty
ItemsControl.ItemsPanelProperty
ItemsControl.ItemsSourceProperty
ItemsControl.ItemStringFormatProperty
ItemsControl.ItemTemplateProperty
ItemsControl.ItemTemplateSelectorProperty
ItemsControl.AddChild(object)
ItemsControl.AddText(string)
ItemsControl.BeginInit()
ItemsControl.ContainerFromElement(ItemsControl, DependencyObject)
ItemsControl.ContainerFromElement(DependencyObject)
ItemsControl.EndInit()
ItemsControl.GetAlternationIndex(DependencyObject)
ItemsControl.GetItemsOwner(DependencyObject)
ItemsControl.IsItemItsOwnContainer(object)
ItemsControl.ItemsControlFromItemContainer(DependencyObject)
ItemsControl.OnAlternationCountChanged(int, int)
ItemsControl.OnDisplayMemberPathChanged(string, string)
ItemsControl.OnGroupStyleSelectorChanged(GroupStyleSelector, GroupStyleSelector)
ItemsControl.OnItemBindingGroupChanged(BindingGroup, BindingGroup)
ItemsControl.OnItemContainerStyleChanged(Style, Style)
ItemsControl.OnItemContainerStyleSelectorChanged(StyleSelector, StyleSelector)
ItemsControl.OnItemsPanelChanged(ItemsPanelTemplate, ItemsPanelTemplate)
ItemsControl.OnItemStringFormatChanged(string, string)
ItemsControl.OnItemTemplateChanged(DataTemplate, DataTemplate)
ItemsControl.OnItemTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)
ItemsControl.ShouldApplyItemContainerStyle(DependencyObject, object)
ItemsControl.ToString()
ItemsControl.AlternationCount
ItemsControl.DisplayMemberPath
ItemsControl.GroupStyle
ItemsControl.GroupStyleSelector
ItemsControl.HasItems
ItemsControl.IsGrouping
ItemsControl.IsTextSearchCaseSensitive
ItemsControl.IsTextSearchEnabled
ItemsControl.ItemBindingGroup
ItemsControl.ItemContainerGenerator
ItemsControl.ItemContainerStyle
ItemsControl.ItemContainerStyleSelector
ItemsControl.Items
ItemsControl.ItemsPanel
ItemsControl.ItemsSource
ItemsControl.ItemStringFormat
ItemsControl.ItemTemplate
ItemsControl.ItemTemplateSelector
ItemsControl.LogicalChildren
Control.BackgroundProperty
Control.BorderBrushProperty
Control.BorderThicknessProperty
Control.FontFamilyProperty
Control.FontSizeProperty
Control.FontStretchProperty
Control.FontStyleProperty
Control.FontWeightProperty
Control.ForegroundProperty
Control.HorizontalContentAlignmentProperty
Control.IsTabStopProperty
Control.MouseDoubleClickEvent
Control.PaddingProperty
Control.PreviewMouseDoubleClickEvent
Control.TabIndexProperty
Control.TemplateProperty
Control.VerticalContentAlignmentProperty
Control.ArrangeOverride(Size)
Control.OnMouseDoubleClick(MouseButtonEventArgs)
Control.OnPreviewMouseDoubleClick(MouseButtonEventArgs)
Control.Background
Control.BorderBrush
Control.BorderThickness
Control.FontFamily
Control.FontSize
Control.FontStretch
Control.FontStyle
Control.FontWeight
Control.Foreground
Control.HorizontalContentAlignment
Control.IsTabStop
Control.Padding
Control.TabIndex
Control.Template
Control.VerticalContentAlignment
Control.MouseDoubleClick
Control.PreviewMouseDoubleClick
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.BindingGroupProperty
FrameworkElement.ContextMenuClosingEvent
FrameworkElement.ContextMenuOpeningEvent
FrameworkElement.ContextMenuProperty
FrameworkElement.CursorProperty
FrameworkElement.DataContextProperty
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.FlowDirectionProperty
FrameworkElement.FocusVisualStyleProperty
FrameworkElement.ForceCursorProperty
FrameworkElement.HeightProperty
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.InputScopeProperty
FrameworkElement.LanguageProperty
FrameworkElement.LayoutTransformProperty
FrameworkElement.LoadedEvent
FrameworkElement.MarginProperty
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidthProperty
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidthProperty
FrameworkElement.NameProperty
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.RequestBringIntoViewEvent
FrameworkElement.SizeChangedEvent
FrameworkElement.StyleProperty
FrameworkElement.TagProperty
FrameworkElement.ToolTipClosingEvent
FrameworkElement.ToolTipOpeningEvent
FrameworkElement.ToolTipProperty
FrameworkElement.UnloadedEvent
FrameworkElement.UseLayoutRoundingProperty
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.WidthProperty
FrameworkElement.AddLogicalChild(object)
FrameworkElement.ApplyTemplate()
FrameworkElement.ArrangeCore(Rect)
FrameworkElement.BeginStoryboard(Storyboard)
FrameworkElement.BeginStoryboard(Storyboard, HandoffBehavior)
FrameworkElement.BeginStoryboard(Storyboard, HandoffBehavior, bool)
FrameworkElement.BringIntoView()
FrameworkElement.BringIntoView(Rect)
FrameworkElement.FindName(string)
FrameworkElement.FindResource(object)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.GetFlowDirection(DependencyObject)
FrameworkElement.GetLayoutClip(Size)
FrameworkElement.GetTemplateChild(string)
FrameworkElement.GetUIParentCore()
FrameworkElement.GetVisualChild(int)
FrameworkElement.MeasureCore(Size)
FrameworkElement.MoveFocus(TraversalRequest)
FrameworkElement.OnContextMenuClosing(ContextMenuEventArgs)
FrameworkElement.OnGotFocus(RoutedEventArgs)
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.OnRenderSizeChanged(SizeChangedInfo)
FrameworkElement.OnStyleChanged(Style, Style)
FrameworkElement.OnToolTipClosing(ToolTipEventArgs)
FrameworkElement.OnToolTipOpening(ToolTipEventArgs)
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.ParentLayoutInvalidated(UIElement)
FrameworkElement.PredictFocus(FocusNavigationDirection)
FrameworkElement.RegisterName(string, object)
FrameworkElement.RemoveLogicalChild(object)
FrameworkElement.SetBinding(DependencyProperty, string)
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetFlowDirection(DependencyObject, FlowDirection)
FrameworkElement.SetResourceReference(DependencyProperty, object)
FrameworkElement.TryFindResource(object)
FrameworkElement.UnregisterName(string)
FrameworkElement.UpdateDefaultStyle()
FrameworkElement.ActualHeight
FrameworkElement.ActualWidth
FrameworkElement.BindingGroup
FrameworkElement.ContextMenu
FrameworkElement.Cursor
FrameworkElement.DataContext
FrameworkElement.DefaultStyleKey
FrameworkElement.FlowDirection
FrameworkElement.FocusVisualStyle
FrameworkElement.ForceCursor
FrameworkElement.Height
FrameworkElement.HorizontalAlignment
FrameworkElement.InheritanceBehavior
FrameworkElement.InputScope
FrameworkElement.IsInitialized
FrameworkElement.IsLoaded
FrameworkElement.Language
FrameworkElement.LayoutTransform
FrameworkElement.Margin
FrameworkElement.MaxHeight
FrameworkElement.MaxWidth
FrameworkElement.MinHeight
FrameworkElement.MinWidth
FrameworkElement.Name
FrameworkElement.OverridesDefaultStyle
FrameworkElement.Parent
FrameworkElement.Resources
FrameworkElement.Style
FrameworkElement.Tag
FrameworkElement.TemplatedParent
FrameworkElement.ToolTip
FrameworkElement.Triggers
FrameworkElement.UseLayoutRounding
FrameworkElement.VerticalAlignment
FrameworkElement.VisualChildrenCount
FrameworkElement.Width
FrameworkElement.ContextMenuClosing
FrameworkElement.ContextMenuOpening
FrameworkElement.DataContextChanged
FrameworkElement.Initialized
FrameworkElement.Loaded
FrameworkElement.RequestBringIntoView
FrameworkElement.SizeChanged
FrameworkElement.SourceUpdated
FrameworkElement.TargetUpdated
FrameworkElement.ToolTipClosing
FrameworkElement.ToolTipOpening
FrameworkElement.Unloaded
UIElement.AllowDropProperty
UIElement.AreAnyTouchesCapturedProperty
UIElement.AreAnyTouchesCapturedWithinProperty
UIElement.AreAnyTouchesDirectlyOverProperty
UIElement.AreAnyTouchesOverProperty
UIElement.BitmapEffectInputProperty
UIElement.BitmapEffectProperty
UIElement.CacheModeProperty
UIElement.ClipProperty
UIElement.ClipToBoundsProperty
UIElement.DragEnterEvent
UIElement.DragLeaveEvent
UIElement.DragOverEvent
UIElement.DropEvent
UIElement.EffectProperty
UIElement.FocusableProperty
UIElement.GiveFeedbackEvent
UIElement.GotFocusEvent
UIElement.GotKeyboardFocusEvent
UIElement.GotMouseCaptureEvent
UIElement.GotStylusCaptureEvent
UIElement.GotTouchCaptureEvent
UIElement.IsEnabledProperty
UIElement.IsFocusedProperty
UIElement.IsHitTestVisibleProperty
UIElement.IsKeyboardFocusedProperty
UIElement.IsKeyboardFocusWithinProperty
UIElement.IsManipulationEnabledProperty
UIElement.IsMouseCapturedProperty
UIElement.IsMouseCaptureWithinProperty
UIElement.IsMouseDirectlyOverProperty
UIElement.IsMouseOverProperty
UIElement.IsStylusCapturedProperty
UIElement.IsStylusCaptureWithinProperty
UIElement.IsStylusDirectlyOverProperty
UIElement.IsStylusOverProperty
UIElement.IsVisibleProperty
UIElement.KeyDownEvent
UIElement.KeyUpEvent
UIElement.LostFocusEvent
UIElement.LostKeyboardFocusEvent
UIElement.LostMouseCaptureEvent
UIElement.LostStylusCaptureEvent
UIElement.LostTouchCaptureEvent
UIElement.ManipulationBoundaryFeedbackEvent
UIElement.ManipulationCompletedEvent
UIElement.ManipulationDeltaEvent
UIElement.ManipulationInertiaStartingEvent
UIElement.ManipulationStartedEvent
UIElement.ManipulationStartingEvent
UIElement.MouseDownEvent
UIElement.MouseEnterEvent
UIElement.MouseLeaveEvent
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonUpEvent
UIElement.MouseMoveEvent
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonUpEvent
UIElement.MouseUpEvent
UIElement.MouseWheelEvent
UIElement.OpacityMaskProperty
UIElement.OpacityProperty
UIElement.PreviewDragEnterEvent
UIElement.PreviewDragLeaveEvent
UIElement.PreviewDragOverEvent
UIElement.PreviewDropEvent
UIElement.PreviewGiveFeedbackEvent
UIElement.PreviewGotKeyboardFocusEvent
UIElement.PreviewKeyDownEvent
UIElement.PreviewKeyUpEvent
UIElement.PreviewLostKeyboardFocusEvent
UIElement.PreviewMouseDownEvent
UIElement.PreviewMouseLeftButtonDownEvent
UIElement.PreviewMouseLeftButtonUpEvent
UIElement.PreviewMouseMoveEvent
UIElement.PreviewMouseRightButtonDownEvent
UIElement.PreviewMouseRightButtonUpEvent
UIElement.PreviewMouseUpEvent
UIElement.PreviewMouseWheelEvent
UIElement.PreviewQueryContinueDragEvent
UIElement.PreviewStylusButtonDownEvent
UIElement.PreviewStylusButtonUpEvent
UIElement.PreviewStylusDownEvent
UIElement.PreviewStylusInAirMoveEvent
UIElement.PreviewStylusInRangeEvent
UIElement.PreviewStylusMoveEvent
UIElement.PreviewStylusOutOfRangeEvent
UIElement.PreviewStylusSystemGestureEvent
UIElement.PreviewStylusUpEvent
UIElement.PreviewTextInputEvent
UIElement.PreviewTouchDownEvent
UIElement.PreviewTouchMoveEvent
UIElement.PreviewTouchUpEvent
UIElement.QueryContinueDragEvent
UIElement.QueryCursorEvent
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformProperty
UIElement.SnapsToDevicePixelsProperty
UIElement.StylusButtonDownEvent
UIElement.StylusButtonUpEvent
UIElement.StylusDownEvent
UIElement.StylusEnterEvent
UIElement.StylusInAirMoveEvent
UIElement.StylusInRangeEvent
UIElement.StylusLeaveEvent
UIElement.StylusMoveEvent
UIElement.StylusOutOfRangeEvent
UIElement.StylusSystemGestureEvent
UIElement.StylusUpEvent
UIElement.TextInputEvent
UIElement.TouchDownEvent
UIElement.TouchEnterEvent
UIElement.TouchLeaveEvent
UIElement.TouchMoveEvent
UIElement.TouchUpEvent
UIElement.UidProperty
UIElement.VisibilityProperty
UIElement.AddHandler(RoutedEvent, Delegate)
UIElement.AddHandler(RoutedEvent, Delegate, bool)
UIElement.AddToEventRoute(EventRoute, RoutedEventArgs)
UIElement.ApplyAnimationClock(DependencyProperty, AnimationClock)
UIElement.ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior)
UIElement.Arrange(Rect)
UIElement.BeginAnimation(DependencyProperty, AnimationTimeline)
UIElement.BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior)
UIElement.CaptureMouse()
UIElement.CaptureStylus()
UIElement.CaptureTouch(TouchDevice)
UIElement.Focus()
UIElement.GetAnimationBaseValue(DependencyProperty)
UIElement.HitTestCore(GeometryHitTestParameters)
UIElement.HitTestCore(PointHitTestParameters)
UIElement.InputHitTest(Point)
UIElement.InvalidateArrange()
UIElement.InvalidateMeasure()
UIElement.InvalidateVisual()
UIElement.Measure(Size)
UIElement.OnAccessKey(AccessKeyEventArgs)
UIElement.OnChildDesiredSizeChanged(UIElement)
UIElement.OnDragEnter(DragEventArgs)
UIElement.OnDragLeave(DragEventArgs)
UIElement.OnDragOver(DragEventArgs)
UIElement.OnDrop(DragEventArgs)
UIElement.OnGiveFeedback(GiveFeedbackEventArgs)
UIElement.OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)
UIElement.OnGotMouseCapture(MouseEventArgs)
UIElement.OnGotStylusCapture(StylusEventArgs)
UIElement.OnGotTouchCapture(TouchEventArgs)
UIElement.OnIsKeyboardFocusedChanged(DependencyPropertyChangedEventArgs)
UIElement.OnIsMouseCaptureWithinChanged(DependencyPropertyChangedEventArgs)
UIElement.OnIsMouseDirectlyOverChanged(DependencyPropertyChangedEventArgs)
UIElement.OnIsStylusCapturedChanged(DependencyPropertyChangedEventArgs)
UIElement.OnIsStylusCaptureWithinChanged(DependencyPropertyChangedEventArgs)
UIElement.OnIsStylusDirectlyOverChanged(DependencyPropertyChangedEventArgs)
UIElement.OnKeyUp(KeyEventArgs)
UIElement.OnLostFocus(RoutedEventArgs)
UIElement.OnLostKeyboardFocus(KeyboardFocusChangedEventArgs)
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.OnLostStylusCapture(StylusEventArgs)
UIElement.OnLostTouchCapture(TouchEventArgs)
UIElement.OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs)
UIElement.OnManipulationCompleted(ManipulationCompletedEventArgs)
UIElement.OnManipulationDelta(ManipulationDeltaEventArgs)
UIElement.OnManipulationInertiaStarting(ManipulationInertiaStartingEventArgs)
UIElement.OnManipulationStarted(ManipulationStartedEventArgs)
UIElement.OnManipulationStarting(ManipulationStartingEventArgs)
UIElement.OnMouseDown(MouseButtonEventArgs)
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.OnMouseUp(MouseButtonEventArgs)
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.OnPreviewDragEnter(DragEventArgs)
UIElement.OnPreviewDragLeave(DragEventArgs)
UIElement.OnPreviewDragOver(DragEventArgs)
UIElement.OnPreviewDrop(DragEventArgs)
UIElement.OnPreviewGiveFeedback(GiveFeedbackEventArgs)
UIElement.OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs)
UIElement.OnPreviewKeyUp(KeyEventArgs)
UIElement.OnPreviewLostKeyboardFocus(KeyboardFocusChangedEventArgs)
UIElement.OnPreviewMouseDown(MouseButtonEventArgs)
UIElement.OnPreviewMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.OnPreviewMouseMove(MouseEventArgs)
UIElement.OnPreviewMouseRightButtonDown(MouseButtonEventArgs)
UIElement.OnPreviewMouseUp(MouseButtonEventArgs)
UIElement.OnPreviewMouseWheel(MouseWheelEventArgs)
UIElement.OnPreviewQueryContinueDrag(QueryContinueDragEventArgs)
UIElement.OnPreviewStylusButtonDown(StylusButtonEventArgs)
UIElement.OnPreviewStylusButtonUp(StylusButtonEventArgs)
UIElement.OnPreviewStylusDown(StylusDownEventArgs)
UIElement.OnPreviewStylusInAirMove(StylusEventArgs)
UIElement.OnPreviewStylusInRange(StylusEventArgs)
UIElement.OnPreviewStylusMove(StylusEventArgs)
UIElement.OnPreviewStylusOutOfRange(StylusEventArgs)
UIElement.OnPreviewStylusSystemGesture(StylusSystemGestureEventArgs)
UIElement.OnPreviewStylusUp(StylusEventArgs)
UIElement.OnPreviewTextInput(TextCompositionEventArgs)
UIElement.OnPreviewTouchDown(TouchEventArgs)
UIElement.OnPreviewTouchMove(TouchEventArgs)
UIElement.OnPreviewTouchUp(TouchEventArgs)
UIElement.OnQueryContinueDrag(QueryContinueDragEventArgs)
UIElement.OnQueryCursor(QueryCursorEventArgs)
UIElement.OnRender(DrawingContext)
UIElement.OnStylusButtonDown(StylusButtonEventArgs)
UIElement.OnStylusButtonUp(StylusButtonEventArgs)
UIElement.OnStylusDown(StylusDownEventArgs)
UIElement.OnStylusEnter(StylusEventArgs)
UIElement.OnStylusInAirMove(StylusEventArgs)
UIElement.OnStylusInRange(StylusEventArgs)
UIElement.OnStylusLeave(StylusEventArgs)
UIElement.OnStylusMove(StylusEventArgs)
UIElement.OnStylusOutOfRange(StylusEventArgs)
UIElement.OnStylusSystemGesture(StylusSystemGestureEventArgs)
UIElement.OnStylusUp(StylusEventArgs)
UIElement.OnTouchDown(TouchEventArgs)
UIElement.OnTouchEnter(TouchEventArgs)
UIElement.OnTouchLeave(TouchEventArgs)
UIElement.OnTouchMove(TouchEventArgs)
UIElement.OnTouchUp(TouchEventArgs)
UIElement.RaiseEvent(RoutedEventArgs)
UIElement.ReleaseAllTouchCaptures()
UIElement.ReleaseMouseCapture()
UIElement.ReleaseStylusCapture()
UIElement.ReleaseTouchCapture(TouchDevice)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.TranslatePoint(Point, UIElement)
UIElement.UpdateLayout()
UIElement.AllowDrop
UIElement.AreAnyTouchesCaptured
UIElement.AreAnyTouchesCapturedWithin
UIElement.AreAnyTouchesDirectlyOver
UIElement.AreAnyTouchesOver
UIElement.BitmapEffect
UIElement.BitmapEffectInput
UIElement.CacheMode
UIElement.Clip
UIElement.ClipToBounds
UIElement.CommandBindings
UIElement.DesiredSize
UIElement.Effect
UIElement.Focusable
UIElement.HasAnimatedProperties
UIElement.HasEffectiveKeyboardFocus
UIElement.InputBindings
UIElement.IsArrangeValid
UIElement.IsEnabled
UIElement.IsEnabledCore
UIElement.IsFocused
UIElement.IsHitTestVisible
UIElement.IsInputMethodEnabled
UIElement.IsKeyboardFocused
UIElement.IsKeyboardFocusWithin
UIElement.IsManipulationEnabled
UIElement.IsMeasureValid
UIElement.IsMouseCaptured
UIElement.IsMouseCaptureWithin
UIElement.IsMouseDirectlyOver
UIElement.IsMouseOver
UIElement.IsStylusCaptured
UIElement.IsStylusCaptureWithin
UIElement.IsStylusDirectlyOver
UIElement.IsStylusOver
UIElement.IsVisible
UIElement.Opacity
UIElement.OpacityMask
UIElement.PersistId
UIElement.RenderSize
UIElement.RenderTransform
UIElement.RenderTransformOrigin
UIElement.SnapsToDevicePixels
UIElement.StylusPlugIns
UIElement.TouchesCaptured
UIElement.TouchesCapturedWithin
UIElement.TouchesDirectlyOver
UIElement.TouchesOver
UIElement.Uid
UIElement.Visibility
UIElement.DragEnter
UIElement.DragLeave
UIElement.DragOver
UIElement.Drop
UIElement.FocusableChanged
UIElement.GiveFeedback
UIElement.GotFocus
UIElement.GotKeyboardFocus
UIElement.GotMouseCapture
UIElement.GotStylusCapture
UIElement.GotTouchCapture
UIElement.IsEnabledChanged
UIElement.IsHitTestVisibleChanged
UIElement.IsKeyboardFocusedChanged
UIElement.IsKeyboardFocusWithinChanged
UIElement.IsMouseCapturedChanged
UIElement.IsMouseCaptureWithinChanged
UIElement.IsMouseDirectlyOverChanged
UIElement.IsStylusCapturedChanged
UIElement.IsStylusCaptureWithinChanged
UIElement.IsStylusDirectlyOverChanged
UIElement.IsVisibleChanged
UIElement.KeyDown
UIElement.KeyUp
UIElement.LayoutUpdated
UIElement.LostFocus
UIElement.LostKeyboardFocus
UIElement.LostMouseCapture
UIElement.LostStylusCapture
UIElement.LostTouchCapture
UIElement.ManipulationBoundaryFeedback
UIElement.ManipulationCompleted
UIElement.ManipulationDelta
UIElement.ManipulationInertiaStarting
UIElement.ManipulationStarted
UIElement.ManipulationStarting
UIElement.MouseDown
UIElement.MouseEnter
UIElement.MouseLeave
UIElement.MouseLeftButtonDown
UIElement.MouseLeftButtonUp
UIElement.MouseMove
UIElement.MouseRightButtonDown
UIElement.MouseRightButtonUp
UIElement.MouseUp
UIElement.MouseWheel
UIElement.PreviewDragEnter
UIElement.PreviewDragLeave
UIElement.PreviewDragOver
UIElement.PreviewDrop
UIElement.PreviewGiveFeedback
UIElement.PreviewGotKeyboardFocus
UIElement.PreviewKeyDown
UIElement.PreviewKeyUp
UIElement.PreviewLostKeyboardFocus
UIElement.PreviewMouseDown
UIElement.PreviewMouseLeftButtonDown
UIElement.PreviewMouseLeftButtonUp
UIElement.PreviewMouseMove
UIElement.PreviewMouseRightButtonDown
UIElement.PreviewMouseRightButtonUp
UIElement.PreviewMouseUp
UIElement.PreviewMouseWheel
UIElement.PreviewQueryContinueDrag
UIElement.PreviewStylusButtonDown
UIElement.PreviewStylusButtonUp
UIElement.PreviewStylusDown
UIElement.PreviewStylusInAirMove
UIElement.PreviewStylusInRange
UIElement.PreviewStylusMove
UIElement.PreviewStylusOutOfRange
UIElement.PreviewStylusSystemGesture
UIElement.PreviewStylusUp
UIElement.PreviewTextInput
UIElement.PreviewTouchDown
UIElement.PreviewTouchMove
UIElement.PreviewTouchUp
UIElement.QueryContinueDrag
UIElement.QueryCursor
UIElement.StylusButtonDown
UIElement.StylusButtonUp
UIElement.StylusDown
UIElement.StylusEnter
UIElement.StylusInAirMove
UIElement.StylusInRange
UIElement.StylusLeave
UIElement.StylusMove
UIElement.StylusOutOfRange
UIElement.StylusSystemGesture
UIElement.StylusUp
UIElement.TextInput
UIElement.TouchDown
UIElement.TouchEnter
UIElement.TouchLeave
UIElement.TouchMove
UIElement.TouchUp
Visual.AddVisualChild(Visual)
Visual.FindCommonVisualAncestor(DependencyObject)
Visual.IsAncestorOf(DependencyObject)
Visual.IsDescendantOf(DependencyObject)
Visual.OnDpiChanged(DpiScale, DpiScale)
Visual.OnVisualChildrenChanged(DependencyObject, DependencyObject)
Visual.PointFromScreen(Point)
Visual.PointToScreen(Point)
Visual.RemoveVisualChild(Visual)
Visual.TransformToAncestor(Visual3D)
Visual.TransformToAncestor(Visual)
Visual.TransformToDescendant(Visual)
Visual.TransformToVisual(Visual)
Visual.VisualBitmapEffect
Visual.VisualBitmapEffectInput
Visual.VisualBitmapScalingMode
Visual.VisualCacheMode
Visual.VisualClearTypeHint
Visual.VisualClip
Visual.VisualEdgeMode
Visual.VisualEffect
Visual.VisualOffset
Visual.VisualOpacity
Visual.VisualOpacityMask
Visual.VisualParent
Visual.VisualScrollableAreaClip
Visual.VisualTextHintingMode
Visual.VisualTextRenderingMode
Visual.VisualTransform
Visual.VisualXSnappingGuidelines
Visual.VisualYSnappingGuidelines
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Equals(object)
DependencyObject.GetHashCode()
DependencyObject.GetLocalValueEnumerator()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.InvalidateProperty(DependencyProperty)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, object)
DependencyObject.SetValue(DependencyProperty, object)
DependencyObject.SetValue(DependencyPropertyKey, object)
DependencyObject.ShouldSerializeProperty(DependencyProperty)
DependencyObject.DependencyObjectType
DependencyObject.IsSealed
DispatcherObject.Dispatcher
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
[TemplatePart(Name = "PART_ScrollViewer", Type = typeof(ScrollViewer))]
[SuppressMessage("Performance", "CA1814:Prefer jagged arrays over multidimensional", Justification = "The multidimensional array does not waste space. Also refactoring with possible bugs.")]
public class DataGrid : DataGrid, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IContainItemStorage, IAddChild
Remarks

The Grid and it's children are heavily dependent on each other. This is quite a bad architecture but that is the way Microsoft build the DataGrid. This was not improved here because this would come near a complete own implementation of a DataGrid.

The DataGrid does not allow resizing of columns by the user when in stacked header mode (MaxHeaderStackCount > 1).

The grid uses DataGridRows, DataGridColumnHeadersPresenter, DataGridCellsPanel and DataGridColumnHeader instead of the respective classes from System.Windows.Controls. Keep this in mind when styling rows and providing styles for the grid.

You can use PreventSelectionReset to prevent the reset of the complete selection when changing SelectionUnit. When changing the SelectionUnit the selection will be cleared and loaded again. So the selection will be empty for a short amount of time.

Examples

The following example shows how to use MaxNumberOfSelectableItems to limit the maximum selectable rows to 5.

<SAF:DataGrid MaxNumberOfSelectableItems="5"
              ItemsSource="{Binding Items}">
    <DataGrid.Columns>
        <DataGridTextColumn Binding="{Binding Name}" />
        <DataGridTextColumn Binding="{Binding Description}" />
    </DataGrid.Columns>
</SAF:DataGrid>

The following example shows how to configure the grid for fixed row heights and distribution of row height among grouped cells. When no columns are grouped the cell height will be 90. When max 2 columns are grouped the cell height will be 45 and with 3 columns grouped 30.

<SAF:DataGrid MaxHeaderStackCount="3"
              DistributeStackHeight="True"
              RowHeight="90"
              ColumnPickerCommand="{Binding ColumnPickerCommand}"
              ItemsSource="{Binding Items}">
    <DataGrid.Columns>
        <DataGridTextColumn Binding="{Binding Name}" />
        <DataGridTextColumn Binding="{Binding Description}" />
        <!-- Some more columns so column grouping becomes useful -->
    </DataGrid.Columns>
</SAF:DataGrid>

The following example shows how to configure the grid for fixed cell heights. The row height will be equal to CurrentHeaderStackCount times MinRowHeight. Use MinRowHeight to define the fixed height of the sub rows (= cell height).

<SAF:DataGrid MaxHeaderStackCount="3"
              MinRowHeight="30"
              ItemsSource="{Binding Items}">
    <DataGrid.Columns>
        <DataGridTextColumn Binding="{Binding Name}" />
        <DataGridTextColumn Binding="{Binding Description}" />
        <!-- Some more columns so column grouping becomes useful -->
    </DataGrid.Columns>
</SAF:DataGrid>

The following example shows styling for rows supporting switching of MaxHeaderStackCount from 1 to greater values.

<SAF:DoubleComparisonToBooleanConverter x:Key="DoubleIsGreaterThanConverter" ComparisonType="GreaterThan" />

<Style x:Key="RowStyle" TargetType="{x:Type DataGridRow}">
    <!-- style for a MaxHeaderRowCount == 1 -->
</Style>

<Style x:Key="MultiRowStyle" TargetType="{x:Type SAF:DataGridRow}">
    <!-- style for a MaxHeaderRowCount > 1 -->
</Style>

<Style x:Key="DataGridStyle" TargetType="{x:Type SAF:DataGrid}">
    <Setter Property="RowStyle" Value="{StaticResource RowStyle}" />
    <Style.Triggers>
        <DataTrigger
            Binding="{Binding MaxHeaderStackCount, RelativeSource={RelativeSource Self}, Converter={StaticResource DoubleIsGreaterThanConverter}, ConverterParameter=1}"
            Value="True">
            <Setter Property="RowStyle" Value="{StaticResource MultiRowStyle}" />
            <!-- Resizing of columns does currently not work well with multi row header -->
            <Setter Property="CanUserResizeColumns" Value="False" />
        </DataTrigger>
    </Style.Triggers>
</Style>

The following example shows how to provide background colors for the sub row backgrounds

<Style x:Key="MultiHeader_RowStyle" TargetType="{x:Type SAF:DataGridRow}">
    <Setter Property="RowBackgroundBrushes">
        <Setter.Value>
            <x:Array Type="Brush">
                <SolidColorBrush Color="{DynamicResource BG_S36}" />
                <SolidColorBrush Color="{DynamicResource BG_S37}" />
                <SolidColorBrush Color="{DynamicResource BG_S03}" />
            </x:Array>
        </Setter.Value>
    </Setter>
    <Style.Triggers>
        <!-- provide different colors when 2 subrows are shown -->
        <Trigger Property="CurrentRowCount" Value="2">
            <Setter Property="RowBackgroundBrushes">
                <Setter.Value>
                    <x:Array Type="Brush">
                        <SolidColorBrush Color="{DynamicResource BG_S36}" />
                        <SolidColorBrush Color="{DynamicResource BG_S03}" />
                    </x:Array>
                </Setter.Value>
            </Setter>
        </Trigger>
    </Style.Triggers>
</Style>

Constructors

View Source

DataGrid()

Initializes a new instance of the DataGrid class.

Declaration
public DataGrid()

Fields

View Source

ActualHeaderHeightProperty

Identifies the ActualHeaderHeight dependency property.

Declaration
public static readonly DependencyProperty ActualHeaderHeightProperty
Field Value
Type Description
DependencyProperty
View Source

ColumnHeaderRowHeightProperty

Identifies the DependencyProperty for ColumnHeaderRowHeight.

Declaration
public static readonly DependencyProperty ColumnHeaderRowHeightProperty
Field Value
Type Description
DependencyProperty
View Source

ColumnPickerCommandProperty

Identifies the DependencyProperty for ColumnPickerCommand.

Declaration
public static readonly DependencyProperty ColumnPickerCommandProperty
Field Value
Type Description
DependencyProperty
View Source

ColumnPickerHeaderProperty

defines the header text of a control (for instance the selection overlay) that can be used to replace columns of the DataGrid

Declaration
public static readonly DependencyProperty ColumnPickerHeaderProperty
Field Value
Type Description
DependencyProperty
View Source

ColumnReplacerHeaderProperty

defines the header text of a control (for instance the selection overlay) that can be used to show/hide columns of the DataGrid

Declaration
public static readonly DependencyProperty ColumnReplacerHeaderProperty
Field Value
Type Description
DependencyProperty
View Source

ContentTypeProperty

Identifies the DependencyProperty for ContentType.

Declaration
public static readonly DependencyProperty ContentTypeProperty
Field Value
Type Description
DependencyProperty
View Source

CurrentHeaderRowCountProperty

Identifies the DependencyProperty for CurrentHeaderRowCount.

Declaration
[Obsolete("Use CurrentHeaderStackCount instead")]
public static readonly DependencyProperty CurrentHeaderRowCountProperty
Field Value
Type Description
DependencyProperty
View Source

CurrentHeaderRowCountPropertyKey

Identifies the DependencyPropertyKey for CurrentHeaderRowCount.

Declaration
[Obsolete("Use CurrentHeaderStackCount instead")]
protected static readonly DependencyPropertyKey CurrentHeaderRowCountPropertyKey
Field Value
Type Description
DependencyPropertyKey
View Source

CurrentHeaderStackCountProperty

Identifies the DependencyProperty for CurrentHeaderStackCount.

Declaration
public static readonly DependencyProperty CurrentHeaderStackCountProperty
Field Value
Type Description
DependencyProperty
View Source

CurrentHeaderStackCountPropertyKey

Identifies the DependencyPropertyKey for CurrentHeaderStackCount.

Declaration
protected static readonly DependencyPropertyKey CurrentHeaderStackCountPropertyKey
Field Value
Type Description
DependencyPropertyKey
View Source

DistributeRowHeightProperty

Identifies the DependencyProperty for DistributeRowHeight.

Declaration
[Obsolete("Use DistributeStackHeight instead")]
public static readonly DependencyProperty DistributeRowHeightProperty
Field Value
Type Description
DependencyProperty
View Source

DistributeStackHeightProperty

Identifies the DependencyProperty for DistributeStackHeight.

Declaration
public static readonly DependencyProperty DistributeStackHeightProperty
Field Value
Type Description
DependencyProperty
View Source

IsColumnPickerEnabledProperty

defines whether the column picker functionality is enabled (true) or not. Default is true

Declaration
public static readonly DependencyProperty IsColumnPickerEnabledProperty
Field Value
Type Description
DependencyProperty
View Source

IsColumnReplacerEnabledProperty

defines whether the column replacer functionality is enabled (true) or not. Default is true

Declaration
public static readonly DependencyProperty IsColumnReplacerEnabledProperty
Field Value
Type Description
DependencyProperty
View Source

IsHeaderEnabledProperty

Identifies the DependencyProperty for IsHeaderEnabled.

Declaration
public static readonly DependencyProperty IsHeaderEnabledProperty
Field Value
Type Description
DependencyProperty
View Source

IsMouseRightButtonEnabledProperty

Identifies the DependencyProperty for IsMouseRightButtonEnabled.

Declaration
public static readonly DependencyProperty IsMouseRightButtonEnabledProperty
Field Value
Type Description
DependencyProperty
View Source

MaxHeaderRowCountProperty

Identifies the DependencyProperty for MaxHeaderRowCount.

Declaration
[Obsolete("Use MaxHeaderStackCount instead")]
public static readonly DependencyProperty MaxHeaderRowCountProperty
Field Value
Type Description
DependencyProperty
View Source

MaxHeaderStackCountProperty

Identifies the DependencyProperty for MaxHeaderStackCount.

Declaration
public static readonly DependencyProperty MaxHeaderStackCountProperty
Field Value
Type Description
DependencyProperty
View Source

MaxNumberOfSelectableItemsProperty

defines the maximal number of selectable items in the data grid. Default is null which is interpreted as no restriction

Declaration
public static readonly DependencyProperty MaxNumberOfSelectableItemsProperty
Field Value
Type Description
DependencyProperty
View Source

NoSearchResultFoundTextProperty

defines the text shown for no search results of a control (for instance the selection overlay) that can be used to search for column header names

Declaration
public static readonly DependencyProperty NoSearchResultFoundTextProperty
Field Value
Type Description
DependencyProperty
View Source

PreventSelectionResetProperty

Identifies the DependencyProperty for PreventSelectionReset.

Declaration
public static readonly DependencyProperty PreventSelectionResetProperty
Field Value
Type Description
DependencyProperty
View Source

SearchTextWatermarkProperty

defines the search text watermark of a control (for instance the selection overlay) that can be used to replace/select columns of the DataGrid and supports filtering

Declaration
public static readonly DependencyProperty SearchTextWatermarkProperty
Field Value
Type Description
DependencyProperty
View Source

SelectionStateProperty

The Dependency Property of the SelectionState property. Gets or sets the state of the selection.

Declaration
public static readonly DependencyProperty SelectionStateProperty
Field Value
Type Description
DependencyProperty

Properties

View Source

ActualHeaderHeight

Gets the current actual height of the DataGridColumnHeadersPresenter

Declaration
public double ActualHeaderHeight { get; }
Property Value
Type Description
double
View Source

ColumnHeaderRowHeight

Gets or sets the row height inside a column header.

Declaration
public double ColumnHeaderRowHeight { get; set; }
Property Value
Type Description
double
Remarks

This is the height of a single draggable header. The height of the complete header is CurrentHeaderStackCount times this height.

View Source

ColumnHeadersPresenter

Gets or sets the current DataGridColumnHeadersPresenter used in the grid.

Declaration
protected DataGridColumnHeadersPresenter ColumnHeadersPresenter { get; set; }
Property Value
Type Description
DataGridColumnHeadersPresenter
View Source

ColumnMatrix

Gets the current column matrix. Dimension 0 is the row index, dimension 1 the column index.

Declaration
public DataGridColumn[,] ColumnMatrix { get; }
Property Value
Type Description
DataGridColumn[,]
View Source

ColumnPickerCommand

Gets or sets the column picker command.

Declaration
public ICommand ColumnPickerCommand { get; set; }
Property Value
Type Description
ICommand
Remarks

When this is set the default SelectionOverlay is not shown.

View Source

ColumnPickerHeader

defines the header text of the selection overlay that can be used to show/hide columns of the DataGrid

Declaration
public string ColumnPickerHeader { get; set; }
Property Value
Type Description
string
View Source

ColumnReplacerHeader

defines the header text of the selection overlay that can be used to replace columns of the DataGrid

Declaration
public string ColumnReplacerHeader { get; set; }
Property Value
Type Description
string
View Source

ContentType

Gets or sets the margin of the cell

Declaration
public DataGridContentType ContentType { get; set; }
Property Value
Type Description
DataGridContentType
View Source

CurrentHeaderRowCount

Gets the current header row count.

Declaration
[Obsolete("Use CurrentHeaderStackCount instead")]
public int CurrentHeaderRowCount { get; }
Property Value
Type Description
int
Remarks

The maximum of this value is MaxHeaderRowCount.

View Source

CurrentHeaderStackCount

Gets the current header stack count.

Declaration
public int CurrentHeaderStackCount { get; }
Property Value
Type Description
int
Remarks

The maximum of this value is MaxHeaderStackCount.

View Source

DistributeRowHeight

Gets or sets a value indicating whether the fixed RowHeight should be equally distributed amongst sub rows.

Declaration
[Obsolete("Use DistributeStackHeight instead")]
public bool DistributeRowHeight { get; set; }
Property Value
Type Description
bool
Remarks

If this is true RowHeight is distributed equally among all header rows. This has no effect if RowHeight is NaN.

View Source

DistributeStackHeight

Gets or sets a value indicating whether the fixed RowHeight should be equally distributed amongst sub rows.

Declaration
public bool DistributeStackHeight { get; set; }
Property Value
Type Description
bool
Remarks

If this is true RowHeight is distributed equally among all stacked headers. This has no effect if RowHeight is NaN.

View Source

IsColumnPickerEnabled

defines whether the column picker functionality is enabled (true) or not. Default is true

Declaration
public bool IsColumnPickerEnabled { get; set; }
Property Value
Type Description
bool
View Source

IsColumnReplacerEnabled

defines whether the column replacer functionality is enabled (true) or not. Default is true

Declaration
public bool IsColumnReplacerEnabled { get; set; }
Property Value
Type Description
bool
View Source

IsHeaderEnabled

Gets or sets a value indicating whether the header is enabled.

Declaration
public bool IsHeaderEnabled { get; set; }
Property Value
Type Description
bool
View Source

IsMouseRightButtonEnabled

Indicates whether the mouse right button can be used for interaction within the DataGrid.

Declaration
public bool IsMouseRightButtonEnabled { get; set; }
Property Value
Type Description
bool
View Source

MaxHeaderRowCount

Gets or sets the maximum header row count.

Declaration
[Obsolete("Use MaxHeaderStackCount instead")]
public int MaxHeaderRowCount { get; set; }
Property Value
Type Description
int
Remarks

Set this to 1 if headers should not be arranged in rows.

View Source

MaxHeaderStackCount

Gets or sets the maximum header stack count.

Declaration
public int MaxHeaderStackCount { get; set; }
Property Value
Type Description
int
Remarks

Set this to 1 if headers should not be arranged in a stack.

View Source

MaxNumberOfSelectableItems

defines the maximal number of selectable items in the data grid. Default is null which is interpreted as no restriction

Declaration
public int? MaxNumberOfSelectableItems { get; set; }
Property Value
Type Description
int?
View Source

NoSearchResultFoundText

defines the text shown for no search results of a control (for instance the selection overlay) that can be used to search for column header names

Declaration
public string NoSearchResultFoundText { get; set; }
Property Value
Type Description
string
View Source

PreventSelectionReset

Gets or sets a value indicating whether the selection reset that occurs on change of the SelectionUnit should be prevented.

Declaration
public bool PreventSelectionReset { get; set; }
Property Value
Type Description
bool

true if selection reset should be prevented; otherwise, false.

Remarks

SelectedItems will be empty for a short period of time when changing SelectionUnit.

View Source

SearchTextWatermark

defines the search text watermark of the selection overlay that can be used to replace/select columns of the DataGrid

Declaration
public string SearchTextWatermark { get; set; }
Property Value
Type Description
string
View Source

SelectionState

Gets or sets the state of the selection.

Declaration
public DataGrid.SelectionStateType SelectionState { get; set; }
Property Value
Type Description
DataGrid.SelectionStateType

Methods

View Source

GetContainerForItemOverride()

Creates or identifies the element used to display the specified item.

Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
Type Description
DependencyObject

A ComboBoxItem.

Overrides
DataGrid.GetContainerForItemOverride()
View Source

InvalidateCellsPanelsMeasure()

Invalidates the cells panels measure.

Declaration
protected void InvalidateCellsPanelsMeasure()
View Source

InvalidateColumnMeasurement()

Invalidates the current column measurement.

Declaration
protected void InvalidateColumnMeasurement()
View Source

IsItemItsOwnContainerOverride(object)

Determines if the specified item is (or is eligible to be) its own ItemContainer.

Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
Type Name Description
object item

Specified item.

Returns
Type Description
bool

true if the item is its own ItemContainer; otherwise, false.

Overrides
DataGrid.IsItemItsOwnContainerOverride(object)
View Source

MoveColumn(DataGridColumn, DataGridColumnDisplayState)

Moves a column to the a desired location if the move operation is allowed.

Declaration
public void MoveColumn(DataGridColumn column, DataGridColumnDisplayState desiredState)
Parameters
Type Name Description
DataGridColumn column

The DataGridColumn to move.

DataGridColumnDisplayState desiredState

The DataGridColumnDisplayState that represents the desired location.

View Source

OnApplyTemplate()

applies the template for the DataGrid

Declaration
public override void OnApplyTemplate()
Overrides
DataGrid.OnApplyTemplate()
View Source

OnColumnHeaderDragCompleted(DragCompletedEventArgs)

Raises the ColumnHeaderDragCompleted event.

Declaration
protected void OnColumnHeaderDragCompleted(DragCompletedEventArgs dragCompletedEventArgs)
Parameters
Type Name Description
DragCompletedEventArgs dragCompletedEventArgs

The data for the event.

View Source

OnColumnHeaderDragDelta(DragDeltaEventArgs)

Raises the ColumnHeaderDragDelta event.

Declaration
protected void OnColumnHeaderDragDelta(DragDeltaEventArgs e)
Parameters
Type Name Description
DragDeltaEventArgs e

The data for the event.

View Source

OnColumnHeaderDragStarted(DragStartedEventArgs)

Raises the ColumnHeaderDragStarted event.

Declaration
protected void OnColumnHeaderDragStarted(DragStartedEventArgs e)
Parameters
Type Name Description
DragStartedEventArgs e

The data for the event.

View Source

OnColumnReordered(DataGridColumnEventArgs)

Raises the ColumnReordered event.

Declaration
protected void OnColumnReordered(DataGridColumnEventArgs dataGridColumnEventArgs)
Parameters
Type Name Description
DataGridColumnEventArgs dataGridColumnEventArgs

The data for the event.

View Source

OnColumnReordering(DataGridColumnReorderingEventArgs)

Raises the ColumnReordering event.

Declaration
protected void OnColumnReordering(DataGridColumnReorderingEventArgs e)
Parameters
Type Name Description
DataGridColumnReorderingEventArgs e

The data for the event.

View Source

OnCurrentCellChanged(EventArgs)

Raises the CurrentCellChanged event.

Declaration
protected override void OnCurrentCellChanged(EventArgs e)
Parameters
Type Name Description
EventArgs e

The data for the event.

Overrides
DataGrid.OnCurrentCellChanged(EventArgs)
View Source

OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)

Called when the IsKeyboardFocusWithin property has changed.

Declaration
protected override void OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type Name Description
DependencyPropertyChangedEventArgs e

The event data.

Overrides
Selector.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs)
View Source

OnItemsSourceChanged(IEnumerable, IEnumerable)

Invoked when the ItemsSource property changes.

Declaration
protected override void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
Parameters
Type Name Description
IEnumerable oldValue

The old source.

IEnumerable newValue

The new source.

Overrides
DataGrid.OnItemsSourceChanged(IEnumerable, IEnumerable)
View Source

OnKeyDown(KeyEventArgs)

Invoked when the KeyDown event is received.

Declaration
[SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Parameter 'e' is never null.")]
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type Name Description
KeyEventArgs e

The information about the event.

Overrides
DataGrid.OnKeyDown(KeyEventArgs)
View Source

OnPreviewKeyDown(KeyEventArgs)

method that checks whether the event is further processed. it is processed if the maximal number of selectable items is not reached

Declaration
[SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Parameter 'e' is never null.")]
protected override void OnPreviewKeyDown(KeyEventArgs e)
Parameters
Type Name Description
KeyEventArgs e
Overrides
UIElement.OnPreviewKeyDown(KeyEventArgs)
View Source

OnPreviewMouseLeftButtonDown(MouseButtonEventArgs)

method that checks whether the event is further processed. it is processed if the maximal number of selectable items is not reached

Declaration
[SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Parameter 'e' is never null.")]
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type Name Description
MouseButtonEventArgs e
Overrides
UIElement.OnPreviewMouseLeftButtonDown(MouseButtonEventArgs)
View Source

OnPreviewMouseRightButtonUp(MouseButtonEventArgs)

Invoked when an unhandled PreviewMouseRightButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

Declaration
[SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Parameter 'e' is never null.")]
protected override void OnPreviewMouseRightButtonUp(MouseButtonEventArgs e)
Parameters
Type Name Description
MouseButtonEventArgs e

The MouseButtonEventArgs that contains the event data. The event data reports that the right mouse button was released.

Overrides
UIElement.OnPreviewMouseRightButtonUp(MouseButtonEventArgs)
View Source

OnSorting(DataGridSortingEventArgs)

Raises the Sorting event.

Declaration
[SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "Parameter 'eventArgs is never null.")]
protected override void OnSorting(DataGridSortingEventArgs eventArgs)
Parameters
Type Name Description
DataGridSortingEventArgs eventArgs

The data for the event.

Overrides
DataGrid.OnSorting(DataGridSortingEventArgs)
View Source

StartColumnChange()

Starts column changes and suppresses column state invalidation until the returned IDisposable is disposed.

Declaration
public IDisposable StartColumnChange()
Returns
Type Description
IDisposable

An IDisposable that defines the life cycle for suppressing any column changes.

View Source

ValidateColumnMove(DataGridColumnDisplayState, DataGridColumnDisplayState)

Checks if a column move is valid.

Declaration
public bool ValidateColumnMove(DataGridColumnDisplayState desiredState, DataGridColumnDisplayState currentState)
Parameters
Type Name Description
DataGridColumnDisplayState desiredState

The desired state of the column.

DataGridColumnDisplayState currentState

The current state of the column.

Returns
Type Description
bool

True if the column move is valid, False otherwise.

Implements

IAnimatable
ISupportInitialize
IFrameworkInputElement
IInputElement
IQueryAmbient
IContainItemStorage
IAddChild

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
DependencyObjectExtensions.XamlClone<T>(T)
DependencyObjectExtensions.FindAncestor<T>(DependencyObject)
DependencyObjectExtensions.FindFirstChildByType<T>(DependencyObject)
DependencyObjectExtensions.FindLogicalAncestor<T>(DependencyObject)
DependencyObjectExtensions.GetChildrenByType<T>(DependencyObject)
DependencyObjectExtensions.GetContainer(DependencyObject)
DependencyObjectExtensions.SetContainer(DependencyObject, CompositionContainer)
FrameworkElementExtensions.FindChildByName<T>(FrameworkElement, string)
  • View Source
Back to top Generated by DocFX