Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 2157

New Post: PropertyGrid With Int Collection

$
0
0
Hi, how can I use PropertyGrid with a collection of ints?

objects used for testing:
    public enum TestType
    {
        One,
        Two,
        Three
    }

    public class Other
    {
        public string Identifier { get; set; }

        public string name { get; set; }

    }

    public class Test
    {
        public string Identifier { get; set; }
        public string name { get; set; }
        public TestType Type { get; set; }
        
        [ExpandableObject]
        public List<int> Types { get; set; }

        [ExpandableObject]
        public Other Other { get; set; }

        public Test()
        {
            this.Other = new Other();
            this.Types = new List<int>(new int[] { 9, 8, 4, 2, 4 });
        }

    }
It appears on the property grid, but it's only a text editor, no number validation, and don't update the property it inserts a empty one.

Viewing all articles
Browse latest Browse all 2157

Trending Articles