windowsforms-devexpress-dot-xtraverticalgrid-dot-pgridoptionsbehavior-c949c7aa.md
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
[DefaultValue(PropertySort.Alphabetical)]
[XtraSerializableProperty]
public virtual PropertySort PropertySort { get; set; }
<DefaultValue(PropertySort.Alphabetical)>
<XtraSerializableProperty>
Public Overridable Property PropertySort As PropertySort
| Type | Default | Description |
|---|---|---|
| PropertySort | Alphabetical |
A PropertySort value that specifies the way properties are sorted in the Property Grid control.
|
Available values:
| Name | Description |
|---|---|
| NoSort |
Properties are displayed in the order specified by the underlying object.
| | Alphabetical |
Properties are sorted in alphabetical order.
|
You can access this nested property as listed below:
| Object Type | Path to PropertySort |
|---|---|
| PropertyGridControl |
.OptionsBehavior .PropertySort
|
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
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
allowCustomSorting = Not allowCustomSorting
propertyGridControl1.OptionsBehavior.PropertySort = If(allowCustomSorting, DevExpress.XtraVerticalGrid.PropertySort.NoSort, DevExpress.XtraVerticalGrid.PropertySort.Alphabetical)
propertyGridControl1.Refresh()
See Also