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

Flatten nested properties?

1 Answer 145 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
BobB
Top achievements
Rank 1
BobB asked on 03 Apr 2017, 01:01 PM
public class Employee
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string Title { get; set; }
    public string HomePhone { get; set; }
}
 
public class Order
{
    public string ShipAddress { get; set; }
    public string ShipName { get; set; }
    public string ShipPostalCode { get; set; }
    public string ShipCountry { get; set; }
    public Employee Employee { get; set; }
}

 

<telerik:RadPropertyGrid Item="{Binding}"
                            NestedPropertiesVisibility="Visible" />

 

Is there a way to flatten the Employee class so it doesn't have to be "opened" to edit it? I would really like to have all the Employee class properties be on the same level as the shipping properties like in the image.

 


1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 03 Apr 2017, 03:28 PM
Hi,

You can use the AutogenerateBindgPaths property (Unbound mode of RadPropertyGrid) to define custom nested hierarchies. In this way you will be able to define a root level list of property definition, specifying binding paths to the nested properties. Here is an article that gives some more extensive info on the topic. It also contains a simple example.

Regards,
Ivan Ivanov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
PropertyGrid
Asked by
BobB
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or