Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display items in PropertyGrid in the sequence they are declared

Is it possible to display PropertyGrid items in the UI in the way they are declared? I found that they are sorted first by CategoryAttribute and then by DisplayName attribute in ascending order.

I'm using .NET version 3.5 using Visual Studio 2010 Ultimate.

EDIT

The application is a WPF application.

like image 222
Donotalo Avatar asked Sep 05 '25 03:09

Donotalo


1 Answers

From this doc: https://learn.microsoft.com/en-US/dotnet/api/system.windows.forms.propertysort

if you set the property PropertySort to PropertySort.NoSort the sorting order of properties should follow this criterium: Properties are displayed in the order in which they are retrieved from the TypeDescriptor.

like image 153
Max Lambertini Avatar answered Sep 07 '25 15:09

Max Lambertini