5 Answers, 1 is accepted
0
Akram
Top achievements
Rank 1
answered on 14 Dec 2012, 03:42 PM
I found the solution by refection,
there is an internal property called CurrentContextPropertyValue inside the field, call it by reflection and you will get the value associated to that field.
This is a sample code
var ss = typeof(PropertyGridField).GetProperty("CurrentContextPropertyValue", (BindingFlags)0xfff).GetValue(field,null);
Thanks,
Akram
there is an internal property called CurrentContextPropertyValue inside the field, call it by reflection and you will get the value associated to that field.
This is a sample code
var ss = typeof(PropertyGridField).GetProperty("CurrentContextPropertyValue", (BindingFlags)0xfff).GetValue(field,null);
Thanks,
Akram
0
Hello,
Ivan Ivanov
the Telerik team
Reflecting member that are not in the API is not a good practice. They are defined for internal use only and sometimes they might behave inconsistently in accordance to you expectations.
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, 04:10 PM
Ok, then please help me to find a safe way
Thanks,
Akram
Thanks,
Akram
0
Hi,
Ivan Ivanov
the Telerik team
Fields are ContentControls. You can get their content, cast it to the expected type (i.e TextBox) and retrieve the current value by reading the respective property (TextBox.Text).
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:23 PM
Hi
This can't be a perfect solution because i need the object to have the same reference to the origin one,
Also, Not all cases can be cased into TextBox, some is DateTimePicker, some is Numeric .
Why not to provide a public property that do the same as the CurrentContextPropertyValue
Thanks,
Akram
This can't be a perfect solution because i need the object to have the same reference to the origin one,
Also, Not all cases can be cased into TextBox, some is DateTimePicker, some is Numeric .
Why not to provide a public property that do the same as the CurrentContextPropertyValue
Thanks,
Akram