Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
TextWrapping is not done for Property Values when length of entered Value exceeds
posted

Hi,

I'm using XamPropertyGrid for Showing the Properties of an Selected object.

when the Property Value has length more than the visual the Wrapping is not done and Cursor moves out of focus loosing the view of What text is being entered.

i tried to use following Trigger but still its not Acheived

   <Style TargetType="{x:Type igEditors:XamTextEditor}">

                <Setter Property="TextWrapping" Value="Wrap"/>

            </Style>

Parents
No Data
Reply
  • 8576
    Offline posted

    Hi Santhosh -

    The best way to achieve this without interfering with the xamPropertyGrid's styling and Themes is to use the property grid's EditorDefinition feature to define a simple editor for properties of type string:

    <igEditors:XamPropertyGrid>

    <igEditors:XamPropertyGrid.EditorDefinitions>

    <igEditors:PropertyGridEditorDefinition TargetType="{x:Type sys:String}">

    <igEditors:PropertyGridEditorDefinition.EditTemplate>

    <DataTemplate>

    <TextBox TextWrapping="Wrap" Text="{Binding EditorValue}"/>

    </DataTemplate>

    </igEditors:PropertyGridEditorDefinition.EditTemplate>

    </igEditors:PropertyGridEditorDefinition>

    </igEditors:XamPropertyGrid.EditorDefinitions>

    </igEditors:XamPropertyGrid>

    Note that you could also specify a list of specific property names within the EditorDefinition if you only wanted a subset of all string properties:

    <ig:PropertyGridEditorDefinition.TargetProperties>

    <sys:String>StringProp1</sys:String>

    <sys:String>StringProp2</sys:String>

    </ig:PropertyGridEditorDefinition.TargetProperties>

    BTW - the above code assumes that there is an xmlns namespace declaration somewhere in your XAML for the prefix 'sys' as shown here:


    xmlns:sys="clr-namespace:System;assembly=mscorlib"

    Hope this helps.

    Joe

     

Children
No Data