I'm new to wpf, but even so I thought this is a trivial problem. So i have а listbox with 4 columns: file names, textbox, checkbox and a button. The buttons are working fine, but for some reason i can't use the textboxes - can't click them or write inside them. Here is my xaml:
<ListBox Name="lbDocxFiles" HorizontalContentAlignment="Stretch" Margin="10,0" Grid.ColumnSpan="2" Grid.Row="2" SelectionChanged="lbDocxFiles_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Margin="0,2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="30" />
<ColumnDefinition Width="70" />
<ColumnDefinition Width="50" />
</Grid.ColumnDefinitions>
<CheckBox x:Name="checkBox" Grid.Column="3" Content="" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox x:Name="tbNodeID" IsReadOnly="False" AcceptsReturn="True" IsEnabled="True" Focusable="True" TextWrapping="Wrap" HorizontalAlignment="Right" Height="25" Width="90" Text="" VerticalAlignment="Center" Grid.ColumnSpan="1">
<TextBox.Style>
<Style TargetType="{x:Type TextBox}">
<Style.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="IsReadOnly" Value="False" />
</Trigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
<Button Grid.Column="2" Width="70" Height="25" Content="UPLOAD" Click="btnUpload_Click" Background="#FF70ECD5" BorderThickness="0" Foreground="White" />
<TextBlock Grid.Column="0" Text="{Binding fileTitle}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
I guess i'm doing something wrong, but can't find out why the texboxes are not editable. Any help will be appreciated! Thanks in advance!