New to Telerik UI for WinForms? Start a free 30-day trial

Compares PropertyGrid items using the table's primary sort property and overall sort direction.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class PropertyGridItemComparer

Inheritance: objectPropertyGridItemComparer

Constructors

Associates the comparer with a table and initializes its cached sort property.

C#
public PropertyGridItemComparer(PropertyGridTableElement propertyGridElement)
Parameters:propertyGridElementPropertyGridTableElement

The table whose sort descriptors and sort direction are used.

Methods

Compares labels, default sort order, or the public property named by the cached sort descriptor. Comparable values are compared directly when their runtime types match; otherwise null and DBNull values are ordered, while other incompatible or non-comparable pairs compare equal. The result is reversed when the table's overall sort order is descending.

C#
public int Compare(PropertyGridItem x, PropertyGridItem y)
Parameters:xPropertyGridItem

The first item to compare.

yPropertyGridItem

The second item to compare.

Returns:

int

A negative value, zero, or a positive value according to the selected sort key and direction.

Refreshes the cached property name from the first sort descriptor and prepares bound-property metadata.

C#
public void Update()