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

Binding to Subclasses

1 Answer 143 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 21 Sep 2011, 01:48 PM
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

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 26 Sep 2011, 11:33 AM
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 >>

Tags
PropertyGrid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or