This is a migrated thread and some comments may be shown as answers.

string[] property order

1 Answer 71 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 03 Jan 2013, 10:55 PM
I have a property of type string[].  If you open the String Collection Editor the items are in the correct order, but when you expand the collection in the PropertyGrid the items appear to be in a random order (instead of being displayed as 0..n).

I am using RadControls for WinForms Q2 2012 SP1.

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 09 Jan 2013, 08:01 AM
Hello Sean,

Thank you for writing.

We are aware of this behavior and have it in our Public Issue Tracking System - PITS. You can track its progress, subscribe for status change alerts and add your vote/comment to it on the following link - PITS Feature. Until the issue is resolved you can work around it by creating a custom IComparer<> class and using it in RadPropertyGrid:
this.radPropertyGrid1.PropertyGridElement.PropertyTableElement.CollectionView.Comparer = new MyComparer();
 
public class MyComparer : IComparer<PropertyGridItem>
{
    public MyComparer()
    {  }
 
    public int Compare(PropertyGridItem x, PropertyGridItem y)
    {
        return x.Label.CompareTo(y.Label);
    }
}

I hope this will be useful .Should you have further questions, I would be glad to help.
 
Kind regards,
Ivan Petrov
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
PropertyGrid
Asked by
Sean
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or