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

Overriding EditorTemplate does not support TextWrapping

1 Answer 97 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
ITC
Top achievements
Rank 1
ITC asked on 05 Dec 2011, 12:15 PM
Hi

I want to have a textbox property in the property grid that supports multiple lines. I have overridden the EditorTemplate as follows:

<telerik:PropertyDefinition Binding="{Binding Description}" DisplayName="Description">
    <telerik:PropertyDefinition.EditorTemplate>
        <DataTemplate>
            <TextBox Text="{Binding Description, Mode=TwoWay}" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" AcceptsReturn="true" />
        </DataTemplate>
    </telerik:PropertyDefinition.EditorTemplate>
</telerik:PropertyDefinition>

When I run the code the long text does not wrap as expected.

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 06 Dec 2011, 11:08 AM
Hi Dirk,

The TextBox won't wrap its text as long as the layout mechanism is "willing" to provide it additional horizontal space. In order to achieve the desired behavior, you should either set MaxWidth value for the TextBox, or disable RadPropertyGrid's horizontal scrolling.

All the best,
Ivan Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
PropertyGrid
Asked by
ITC
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or