How do I get textbox to fill the column and autoscroll?
- by Stephen Price
I have the following code in my DataGridTemplateColumn:
<Controls:DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBox Text="{Binding AlternateTeacherName, Mode=TwoWay}" Style="{StaticResource InputTextBox}"/>
</StackPanel>
</DataTemplate>
Style is:
<Style x:Key="InputTextBox" TargetType="TextBox" >
<Setter Property="Margin" Value="1" />
<Setter Property="MinWidth" Value="30" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="TextAlignment" Value="Left" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
Problem I'm getting is that the textbox fills the column width correctly (including when you resize it) but if I type into the textbox the cursor is not visible when it reaches the end of the line. I'd like the text to scroll off the left so that the current text is still visible.
thanks