This project has moved. For the latest updates, please go here.

Sorting

May 15, 2013 at 11:01 PM
Hello all,

I just started using the PropertGrid and have the following question:

Is it possible to disable the automatic sorting of the grid?

The reason is that I have an object with only a few properties and the order of the properties in the class definition as it is makes sense to the user. The automatic alphabetic sorting does confuse the user.

Thanks for any ideas!
Nick
May 16, 2013 at 4:04 AM
for custom sort properties use PropertyOrderAttribute:
[Xceed.Wpf.Toolkit.PropertyGrid.Attributes.PropertyOrder(10)]
public string FirstName { get; set; }
[Xceed.Wpf.Toolkit.PropertyGrid.Attributes.PropertyOrder(20)]
public string SecondName { get; set; }
May 16, 2013 at 10:17 AM
Fantastico !

Many thanks,
Nick
May 20, 2013 at 11:54 PM
Any chance in the future to support the DisplayAttribute that is available in the ComponentModel.DataAnnotation.dll?

(It contains many handy properties, being one of them the Order int property. It also has a Prompt property for watermarks)
May 21, 2013 at 4:03 AM
support the DisplayAttribute available
[Xceed.Wpf.Toolkit.PropertyGrid.Attributes.PropertyOrder(10)]
[DisplayName("First name")]
public string FirstName { get; set; }
May 21, 2013 at 12:41 PM
Edited May 21, 2013 at 12:42 PM
I know about Xceed's own attribute for sorting properties.

The thing is that I keep many of the classes that define properties to show on PropertyGrid controls in a separated assembly (dll) that does not reference to any WPF assembly, so I was hoping to avoid having to consume the whole toolkit in a dll that uses no WPF controls. And only reference the toolkit in the frontend exe assembly where WPF controls are used.
May 21, 2013 at 2:21 PM
Ultrahead,
vote for this issue:
https://wpftoolkit.codeplex.com/workitem/18934
May 21, 2013 at 2:26 PM
Done. Thanks!