Hi have a very simple WPF DataGrid layout as follows:
<wpftk:DataGrid Grid.Row="1"
x:Name="myOrdersGrid"
ColumnHeaderStyle="{DynamicResource FilterColumnHeaderStyle}"
CanUserResizeColumns="True"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch">
<wpftk:DataGrid.Resources>
<Style x:Key="FilterColumnHeaderStyle" TargetType="{x:Type Primitives:DataGridColumnHeader}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Primitives:DataGridColumnHeader}">
<WrapPanel Width="50" Orientation="Vertical">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Stretch" />
<TextBox Text="Hello" FontSize="10" Background="OldLace" HorizontalAlignment="Center" />
</WrapPanel >
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</wpftk:DataGrid.Resources>
<wpftk:DataGrid.Columns>
<wpftk:DataGridTextColumn SortMemberPath="Name" Binding="{Binding Name}" IsReadOnly="True"/>
<wpftk:DataGridTextColumn SortMemberPath="Name" Binding="{Binding Price}" IsReadOnly="True"/>
</wpftk:DataGrid.Columns>
</wpftk:DataGrid>
The intention is to drop a textbox into each header, in order to act as a filter.
However, when this renders, I get an extra textbox floating halfway across the datagrid, as follows:
Anyone know why? I've played around with all sorts of settings etc, but can't figure out why this is happening (let alone how to fix it....). The extra textbox doesn't seem to be enabled/clickable so it looks like it's some sort of disabled/glasspaned scenario.