How to bind to property of custom user control.

2 posts, 0 answers
  1. Nik
    Nik avatar
    1 posts
    Member since:
    Jul 2013

    Posted 26 Jul 2013 Link to this post

    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>




  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 31 Jul 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top