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

Hyperlink in ProperyGrid and more subgroups

3 Answers 191 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 29 May 2015, 08:44 AM

Hello Telerik,

I have two small questions about PropertyGrid.

1. Is possible to have a hyperlink in one Property Value (not entire column, just one or several values to be URL)

2. I've tested the nice feature of grouping. Can I have more sub-groups there, or expandable one, eg:

Distributors (main group)

         Belnor ( sub group)

                 Property - Value

                 Property - Value

         Kirkwald (sub group)

                 Property - Value

                 Property - Value

 Thanks in advance,

     

 

 

    

 

 

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Jun 2015, 12:30 PM
Hello Robert,

Thank you for writing.

The flexible mechanism of RadPropertyGrid gives you the opportunity to create custom items with the desired nested elements. Thus, you can use a RadLabelElement with underlined text on which Click event you can perform the required action. Please refer to our PropertyGrid >> Custom items help article.

When you need to display a property of complex type composed of several properties, it is suitable to use the ExpandableObjectConverter:
public Form1()
{
    InitializeComponent();
 
    this.radPropertyGrid1.SelectedObject = new MainObject(new FirstLevel(
                                    new SecondLevelA(1,11),new SecondLevelB(2,22)));
}
 
public class MainObject
{
    [TypeConverter(typeof(ExpandableObjectConverter))]
    public FirstLevel mainProp { get; set; }
 
    public MainObject(FirstLevel mainProp)
    {
        this.mainProp = mainProp;
    }
}
 
public class FirstLevel
{
    [TypeConverter(typeof(ExpandableObjectConverter))]
    public SecondLevelA propA { get; set; }
 
    [TypeConverter(typeof(ExpandableObjectConverter))]
    public SecondLevelB propB { get; set; }
 
    public FirstLevel(SecondLevelA propA, SecondLevelB propB)
    {
        this.propA = propA;
        this.propB = propB;
    }
}
 
public class SecondLevelA
{
    public int A { get; set; }
 
    public int AA { get; set; }
 
    public SecondLevelA(int a, int aA)
    {
        this.A = a;
        this.AA = aA;
    }
}
 
public class SecondLevelB
{
    public int B { get; set; }
 
    public int BB { get; set; }
 
    public SecondLevelB(int b, int bB)
    {
        this.B = b;
        this.BB = bB;
    }
}

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
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
0
Robert
Top achievements
Rank 1
answered on 02 Jun 2015, 01:43 PM

Hello Dess,

Thanks for answer. I solve'it by using PropertyStore and decorating sub-classes with ExpandableObjectConverter which is ok but read-only argument still not working for sub-categories.

I wonder if a class can be write for (so complicated) PropertyGrid working with run-time elements. It's somehow time consuming for me as amateur and keeps distracting me for main application goal.

 Would be very nice to have something like

AddNode(name, description, arguments)

AddSubNode(node,etc, etc)

 

 

 

 

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 Jun 2015, 07:23 AM
Hello Robert,

Thank you for writing back.

In order to make a property item read-only, you can specify the ReadOnly attribute for the certain property in you class. It can not be edited on my end (property "B"). Please refer to the attached gif file. Alternatively, in order to disable editing for a specific property you can cancel the RadPropertyGrid.Editing event.

RadPropertyGrid can be populated with data by using two approaches: setting the SelectedObject property to a custom object, or to a RadPropertyStore. It is up to which approach is suitable for your case.

I hope this information helps. If you have any additional questions, please let me know.
 
Regards,
Dess
Telerik
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
Tags
PropertyGrid
Asked by
Robert
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Robert
Top achievements
Rank 1
Share this question
or