Array vs List

3 posts, 1 answers
  1. Maciej
    Maciej avatar
    2 posts
    Member since:
    Sep 2015

    Posted 27 Oct 2015 Link to this post


    I wonder if it is possible to work with lists and arrays in RadPropertyGrid in the same way. Maybe some example will clarify my problem:

    At runtime I bind object of type shown below to RadPropertyGrid.Item:

    public class ​SampleType
            public int Id { get; set; }
            public string Content { get; set; }
            public int[] array { get; set; }
            public List<int> list { get; set; }

    List is initialized but empty, the same in the case of the array.

    In GUI I can modify list property (add/remove items and modify their content), but array property cannot be modified in any way. I understand more static nature of arrays in .NET, but maybe it is possible to enable 'dynamic arrays' in RadPropertyGrid using some property or custom made extension method.

    I would be most grateful if you would look into this matter as soon as possible and at least tell me if it is possible :).


    Best Regards,

    Maciej Nowicki

  2. Answer
    Stefan avatar
    1073 posts

    Posted 30 Oct 2015 Link to this post

    Hello Maciej,

    The editing functionality of CollectionEditor should not be affected when you are using an array for its Source property. However, I am afraid that the add and remove functionalities of the control would not be possible to work with an Array class, as this conflicts with the basic concept of this data structure. Moreover, the control is not meant to provide functionality for such modifications.

    So, I suggest you using a data structure that is dynamic in nature, instead of array. Would it be possible for you to elaborate on your obstacle to doing so?

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Maciej
    Maciej avatar
    2 posts
    Member since:
    Sep 2015

    Posted 30 Oct 2015 Link to this post

    Hello Stefan,

    Thank you for reply, now I know that I have to change arrays to lists everywhere I want to use given model in RadPropertyGrid and there is no less invasive method to deal with that problem. It is good to me, thanks once more.




Back to Top