Binding to Subclasses

2 posts, 0 answers
  1. Daniel
    Daniel avatar
    19 posts
    Member since:
    Nov 2010

    Posted 21 Sep 2011 Link to this post

    I want to use collapsable Key-Name pairs, similar to Points(x,y) which show on one line but can be expanded to separate x and y lines.
    But I do not see the Subclass Fields in the property grid. What is missing?

      //some Subclasses  
       [Category("Detail")]
        public class WorktypeInfo
        {
            private string _WorktypeNo;
            private   string _WorktypeName;
      
            [Category("Detail")]
            public string WorktypeNo
            {
                get
                {
                    return _WorktypeNo;
                }
                set
                {
                    _WorktypeNo = value;
                }
      
            }
      
      
    //used in Mainclass 
      
            [Category("Detail")]
            [Description("Tätigkeitscode")]
            public WorktypeInfo WorktypeInfo
            {
                get
                {
                    return _WorktypeInfo;
                }
                set
                {
                    _WorktypeInfo = value;
                }
            }
      
    ...

    Any help is appreciated...Thanks  Daniel

  2. Ivan Petrov
    Admin
    Ivan Petrov avatar
    692 posts
    Member since:
    Sep 2012

    Posted 26 Sep 2011 Link to this post

    Hello Daniel,

    Thank you for writing and for the provided code.

    This is a feature other users have also asked for and we will implement it in our next major release, which is scheduled for the middle of November. Until then you can create your custom type converter which will allow you to control the behavior of the RadPropertyGrid when dealing with your classes and properties. I have attached a demo project where I have implemented a sample type converter.

    I hope this will help. If you have further questions, I would be glad to help.

    Kind regards,
    Ivan Petrov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top