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

ExpandableObject

Developer
Mar 9, 2015 at 12:50 PM
"There are so many things wrong when you use collection. 1) When you use ExpandableObject Array expands but the array is not sorted by index. How do I sort it by index. 2) Using ExpandableObject on List or Dictionary doesn't work at all. I can't see the elements of list when I expand the list."
Developer
Mar 9, 2015 at 12:58 PM
Hi,

1) Can you post a sample of this ? How do you define your array ? Is it something like :
_propertyGrid.SelectedObject = new MyObject()
      {
         MyArray = new string[3] { "Carl", "Julia", "Megan"}
      };

 public class MyObject
  {
    [ExpandableObject()]
    public string[] MyArray
    {
      get;
      set;
    }
  }
2) For List or Dictionnary, we use the CollectionControl, available with the arrow on the PropertyItem line. Opening it will let you add/remove/modify the List content. If you use ExpandableObject() attribute on a List Property, you will see List's public properties : Capacity and Count.
Developer
Mar 9, 2015 at 1:00 PM