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

Nested Property parent

6 Answers 104 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Akram
Top achievements
Rank 1
Akram asked on 13 Dec 2012, 02:37 PM
Hi
is there a way to get the Parent PropertyGridField of a nested property.

I saw a property called ParentField, but unfortunately this property is visualize tree only, i can see it only in vs debugging

Thanks,
Akram

6 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 14 Dec 2012, 01:43 PM
Hi,

ParentField is an internal property of PropertyGridField. You can try traversing the VisualTree to find the field that you need. Would you please what are you trying to achieve, so that we could think of some more elegant solution?

All the best,
Ivan Ivanov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Akram
Top achievements
Rank 1
answered on 14 Dec 2012, 03:34 PM
Thanks for your replay, i found the solution using .net reflection.
To get the parent field just call field.ParentOfType<PropertyGridField>();

Now i am stuck on refreshing the PropertyGridField value, my case is when i change the value out side the PropertyGrid then i still the same old value inside the PropertyGridField. I know i should dervive from INotifyPropertyChanged interface but unfortunately i can't do that for my case. 
What i need is a way to tell the properyGrid to refresh its values from the origin source. 



Thanks
Akram
0
Ivan Ivanov
Telerik team
answered on 14 Dec 2012, 04:04 PM
Hi,

RadPropertyGrid relies exclusively on bindings and bindings get notified of changes via the INotifyPropertyChanged interface. There is no alternative solution. Would you please share why can't you use it?

All the best,
Ivan Ivanov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Akram
Top achievements
Rank 1
answered on 14 Dec 2012, 04:08 PM
Yes, there are several reasons, one of them is the object is in a closed dll (i am not the owner of the object).

All i need is a way to tell the PropertyGridField to re read the value again from the origin source, so i can call this method after i update the value out side the propertyGrid

Thanks,
Akram
0
Ivan Ivanov
Telerik team
answered on 14 Dec 2012, 04:16 PM
Hello,

In case this class is not sealed, you can inherit from it, implement the interface on the new class and wrap the inherited properties raising the PropertyChanged event in the setters.

Greetings,
Ivan Ivanov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Akram
Top achievements
Rank 1
answered on 14 Dec 2012, 07:26 PM
I am not believe that this is a good idea, all i want is a way to refresh the current field value.

My project depend on this thing, i can't  continue using RadPropertyGrid if this feature impossible to work,

Thanks
Akram 
Tags
PropertyGrid
Asked by
Akram
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Akram
Top achievements
Rank 1
Share this question
or