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

How to bind to property of custom user control.

1 Answer 115 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Nik
Top achievements
Rank 1
Nik asked on 26 Jul 2013, 01:40 PM
For some type of Data I'm write my own control for property grid. How to specify  what property in MyUserControl should be used for bindind?

<telerik:RadPropertyGrid 
  AutoGeneratePropertyDefinitions="True"
EditorTemplateSelector="{StaticResource DataTemplateSelector}"
>
</telerik:RadPropertyGrid>

<local:PropertyTemplateSelector x:Key="DataTemplateSelector">
  <local:PropertyTemplateSelector.MyDataStructTemplate>
<DataTemplate DataType=" MyDataStruct ">
  <StackPanel>   
   <local:MyUserControl/>
</StackPanel>
</DataTemplate>
</local:PropertyTemplateSelector. MyDataStructTemplate >
</local:PropertyTemplateSelector>




1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 31 Jul 2013, 03:19 PM
Hello,

 I guess that the essence of the problem is that you need to reuse this DataTemplate, to display the value of multiple properies, with different names and a common property type. In the scope of RadPropertyGrid, we have solved it by introducing the AutoBind behavior. Here is a support article that shed some more light on the matter.

Regards,
Ivan Ivanov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
PropertyGrid
Asked by
Nik
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or