Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

My own Enum Editor

$
0
0

Hi,

i want to register my own EnumEditor, but somehow my ControlTemplate does not get applied to my Editor. That is my code:

Properties.RegisterPropertyEditor(typeof(Enum), typeof(MyEnumEditor));
<StyleTargetType="local:MyEnumEditor">
    <SetterProperty="Template">
        <Setter.Value>
            <ControlTemplate>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinitionHeight="Auto"/>
                        <RowDefinitionHeight="Auto"/>
                    </Grid.RowDefinitions>
                    <TextBlockHorizontalAlignment="Left"Foreground="Black"FontSize="16"
                               Text="{Binding PropertyName, Mode=TwoWay}"Margin="0,0,0,2"/>
                    <ComboBoxGrid.Row="1"ItemsSource="{Binding PropertyValue, Mode=TwoWay}"/>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

and finally my EditorClass:

using Telerik.UI.Xaml.Controls.Data;
 
namespace BizPerf.Dashboard
{
    public class MyEnumEditor:TypeEditor
    {
       public MyEnumEditor()
        {
            this.DefaultStyleKey = (object) typeof(MyEnumEditor);
        }
    }
}

Can you please tell me how I will get this fixed? Every other editor of mine works..

Thank you!


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>