Back to Devexpress

PGridOptionsBehavior.PropertySort Property

windowsforms-devexpress-dot-xtraverticalgrid-dot-pgridoptionsbehavior-c949c7aa.md

latest4.1 KB
Original Source

PGridOptionsBehavior.PropertySort Property

Gets or sets the way properties are sorted in the Property Grid control.

Namespace : DevExpress.XtraVerticalGrid

Assembly : DevExpress.XtraVerticalGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid

Declaration

csharp
[DefaultValue(PropertySort.Alphabetical)]
[XtraSerializableProperty]
public virtual PropertySort PropertySort { get; set; }
vb
<DefaultValue(PropertySort.Alphabetical)>
<XtraSerializableProperty>
Public Overridable Property PropertySort As PropertySort

Property Value

TypeDefaultDescription
PropertySortAlphabetical

A PropertySort value that specifies the way properties are sorted in the Property Grid control.

|

Available values:

NameDescription
NoSort

Properties are displayed in the order specified by the underlying object.

| | Alphabetical |

Properties are sorted in alphabetical order.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to PropertySort
PropertyGridControl

.OptionsBehavior .PropertySort

|

Remarks

The PropertySort property, along with the BaseOptionsView.ShowRootCategories option, controls the visible order of properties in the Property Grid control.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the PropertySort property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-property-grid-custom-sorting/CS/Form1.cs#L29

csharp
allowCustomSorting = !allowCustomSorting;
propertyGridControl1.OptionsBehavior.PropertySort = allowCustomSorting ? DevExpress.XtraVerticalGrid.PropertySort.NoSort : DevExpress.XtraVerticalGrid.PropertySort.Alphabetical;
propertyGridControl1.Refresh();

winforms-property-grid-custom-sorting/VB/Form1.vb#L27

vb
allowCustomSorting = Not allowCustomSorting
propertyGridControl1.OptionsBehavior.PropertySort = If(allowCustomSorting, DevExpress.XtraVerticalGrid.PropertySort.NoSort, DevExpress.XtraVerticalGrid.PropertySort.Alphabetical)
propertyGridControl1.Refresh()

See Also

ShowRootCategories

SetOrder(Int32)

PGridOptionsBehavior Class

PGridOptionsBehavior Members

DevExpress.XtraVerticalGrid Namespace