WPF TextBox Wrapping WPF TextBox Wrapping wpf wpf

WPF TextBox Wrapping


although the view gets scrollbars

Disable the horizontal scrollView, so it will be forced to wrap. You can try to disable it on the TextBox itself, or on the wrapping Grid.

<DataTemplate x:Key="NotesTemplate">    <Grid ScrollViewer.HorizontalScrollBarVisibility="Disabled">        <Grid.RowDefinitions>            <RowDefinition Height="Auto" />            <RowDefinition Height="*" />        </Grid.RowDefinitions>        <TextBlock Text="Use the box below to record any general notes associated with this item." Style="{StaticResource Default}" />        <TextBox TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" Grid.Row="1" Margin="20" Text="{Binding Notes, UpdateSourceTrigger=PropertyChanged}" />     </Grid></DataTemplate>