This question is locked. New answers and comments are not allowed.
I am trying to use a PropertyGrid for setting properties of various object types.
My requirement is that for a given property, I should be able to select Value from the RadComboBox and set it on the property of a given object.
I dont want to assign it based on ProprtyName and hardcode it in event handler, so I am setting custom attributes on properties and using them to assign perticular template for a given attribute.
I have defined the DataTemplate in xaml and assining it in codebehind in AutoGeneratingPropertyDefinition event handler.
I want to use same template for different properties might be with some slight change. i.e. Onlt SelectedValue path has to be changed in a below template.
My requirement is that for a given property, I should be able to select Value from the RadComboBox and set it on the property of a given object.
I dont want to assign it based on ProprtyName and hardcode it in event handler, so I am setting custom attributes on properties and using them to assign perticular template for a given attribute.
I have defined the DataTemplate in xaml and assining it in codebehind in AutoGeneratingPropertyDefinition event handler.
I want to use same template for different properties might be with some slight change. i.e. Onlt SelectedValue path has to be changed in a below template.
<DataTemplate x:Key="DataProviderTemplate">
<telerik:RadComboBox ItemsSource="{Binding Source={StaticResource DataContextProxy}, Path=DataSource.DataSources}" DisplayMemberPath="Name" SelectedValuePath="Name" SelectedValue="{Binding Path=PermissionedUserSearchTextBoxDPName, Mode=TwoWay}" Margin="2,0,0,0" VerticalAlignment="Center"> </telerik:RadComboBox>
CodeBehind in event handler is
DataTemplate dt = LayoutRoot.Resources["DataProviderTemplate"] as DataTemplate;
e.PropertyDefinition.EditorTemplate = dt;
But I am facing issue of binding PropertyValue in the template.
I also tried changing RadComboBox.SelectedValue's binding path in template using code behind, but it is of not much help.
Please advice.