Table of Contents

Class DataGridHelper

Namespace
Loehnert.Utility.Wpf
Assembly
Loehnert.Utility.dll

Represents a helper class that provides various extensions for the DataGrid control.

public static class DataGridHelper
Inheritance
DataGridHelper
Inherited Members

Fields

ScrollToNewestRowProperty

This property enables a DataGrid to automatically scroll to the row of a new item as it is added.

public static readonly DependencyProperty ScrollToNewestRowProperty

Field Value

DependencyProperty

Examples

<UserControl xmlns:u="http://lisrt.de/utility">
   <DataGrid u:DataGridHelper.ScrollToNewestRow="True" ItemsSource="{Binding Items}"/>
</UserControl>

ThreeStateSortingProperty

This property enables a DataGrid for three state sorting. This means that when a user clicks on the column header, the items will be displayed in ascending order, then in descending order, and then unsorted.

public static readonly DependencyProperty ThreeStateSortingProperty

Field Value

DependencyProperty

Examples

<UserControl xmlns:u="http://lisrt.de/utility">
   <DataGrid u:DataGridHelper.ThreeStateSorting="True" ItemsSource="{Binding Items}"/>
</UserControl>

Methods

GetScrollToNewestRow(DependencyObject)

Gets the value of the ScrollToNewestRowProperty for the element.

public static bool GetScrollToNewestRow(DependencyObject element)

Parameters

element DependencyObject

Element with the attached dependency property.

Returns

bool

The current value of the auto scroll property.

GetThreeStateSorting(UIElement)

Gets the value of the ThreeStateSortingProperty for the element.

[AttachedPropertyBrowsableForType(typeof(DataGrid))]
public static bool GetThreeStateSorting(UIElement element)

Parameters

element UIElement

Element with the dependency property.

Returns

bool

The current value of the three ThreeStateSortingProperty.

SetScrollToNewestRow(DependencyObject, bool)

Sets the value of the ScrollToNewestRowProperty for the element.

public static void SetScrollToNewestRow(DependencyObject element, bool value)

Parameters

element DependencyObject

Element with the attached dependency property.

value bool

Value to set.

SetThreeStateSorting(UIElement, bool)

Sets the value of the ThreeStateSortingProperty for the element.

[AttachedPropertyBrowsableForType(typeof(DataGrid))]
public static void SetThreeStateSorting(UIElement element, bool value)

Parameters

element UIElement

Element with the dependency property.

value bool

Value to set.