Overriding BuiltinEditors.TextBoxValueTemplateKey doesn't work

Grids for WPF Forum

Posted 5 years ago by Eli Arbel
Version: 11.1.0545
Environment: Windows 8 (64-bit)
Avatar

I have the following code:

 

<UserControl>
    <UserControl.Resources>
        <DataTemplate x:Key="{x:Static p:BuiltinEditors.TextBlockNameTemplateKey}">
              ...
        </DataTemplate>

        <DataTemplate x:Key="{x:Static p:BuiltinEditors.TextBoxValueTemplateKey}">
              ...
        </DataTemplate>
    </FrameworkElement.Resources>
    <Grid>
        <p:PropertyGrid Name="pg"
                        PropertyExpandability="ForceAlways"
                        CollectionDisplayMode="EditableInline">
            <p:PropertyGrid.PropertyEditors>
                <p:PropertyEditor PropertyType="{conv:ArrayType sys:Byte}">
                    <p:PropertyEditor.ValueTemplate>
                        <DataTemplate>
                             ...
                        </DataTemplate>
                    </p:PropertyEditor.ValueTemplate>
                </p:PropertyEditor>
                <p:PropertyEditor PropertyType="{x:Type sys:Guid}">
                    <p:PropertyEditor.ValueTemplate>
                        <DataTemplate>
                             ...
                        </DataTemplate>
                    </p:PropertyEditor.ValueTemplate>
                </p:PropertyEditor>
    </Grid>
</UserControl>

 The Byte/Guid editors and TextBlockNameTemplateKey all work, but the TextBoxValueTemplateKey doesn't. Why is that?

 

Thanks,

Eli.

Comments (3)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Eli,

Do you have a new simple sample project that repros this that you could email to our support address?  Please reference this thread and rename the .zip file extension so it doesn't get spam blocked.  We will use that to debug what's going on.  Thanks!


Actipro Software Support

Answer - Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Eli,

Thanks for the sample.  If you change your DataTemplate to this, it works since DynamicValueTemplateKey is the default value template for properties:

<DataTemplate x:Key="{x:Static p:BuiltinEditors.DynamicValueTemplateKey}">


Actipro Software Support

Posted 5 years ago by Eli Arbel
Avatar

Thanks! :)

The latest build of this product (v2018.1 build 0675) was released 9 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.