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

Expandable object editable in Property Grid

1 Answer 107 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Yefan
Top achievements
Rank 1
Veteran
Yefan asked on 23 Jun 2020, 10:03 PM

Hello,

I'd like to edit an expandable object in Property Grid. For instance, when I change the value in one child property, it also changes the result in the parent property, and vice-versa. 

ParentProperty  (X value); (Y value); (Z value)

ChildXProperty  (X value)

ChildYProperty  (Y value)

ChildZProperty  (Z value)

Let's say ChildX and ChildY are Double, and ChildZ is Integer. Thank you for help.

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 26 Jun 2020, 11:32 AM

Hello Yefan,

In order to update the parent property when it's children are modified you can use the following approach:

1. Implement INotifyPropertyChanged for the parent property
2. Add event handler to handle the PropertyChanged event.

I am attaching a sample project demonstrating what I have in mind.

Regards,
Vladimir Stoyanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
PropertyGrid
Asked by
Yefan
Top achievements
Rank 1
Veteran
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or