DataGridTextColumn 上的拼写检查器
Spellchecker on DataGridTextColumn
美好的一天。我仍然是一名初级程序员,最近开始使用 WPF 进行编码。我有一个数据网格,我可以在其中生成自己的列。在一个特定的列(DataGridTextColumn)中,我必须应用拼写检查(用户可以向该字段添加注释)。但我无法做到这一点。我试过应用一种风格但没有运气。任何援助将不胜感激!这是该列的编码:
<DataGridTextColumn x:Name="clValueComment" Binding="{Binding CommentColumn, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="ROOTCAUSE OR COMMENT" Width="*" IsReadOnly="False" Style="{StaticResource Spell}">
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="Black" />
</Trigger>
<DataTrigger Binding="{Binding valueTypeID}" Value="1">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Label IsEnabled="False"/>
</DataTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
在试用了更多样式选项后,我找到了一个似乎有效的解决方案。我会 post 它作为可能遇到相同需求的人的答案。 XAML 的代码是:
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="TextBox">
<Setter Property="SpellCheck.IsEnabled" Value="True"/>
</Style>
</DataGridTextColumn.EditingElementStyle>
美好的一天。我仍然是一名初级程序员,最近开始使用 WPF 进行编码。我有一个数据网格,我可以在其中生成自己的列。在一个特定的列(DataGridTextColumn)中,我必须应用拼写检查(用户可以向该字段添加注释)。但我无法做到这一点。我试过应用一种风格但没有运气。任何援助将不胜感激!这是该列的编码:
<DataGridTextColumn x:Name="clValueComment" Binding="{Binding CommentColumn, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="ROOTCAUSE OR COMMENT" Width="*" IsReadOnly="False" Style="{StaticResource Spell}">
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="Black" />
</Trigger>
<DataTrigger Binding="{Binding valueTypeID}" Value="1">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Label IsEnabled="False"/>
</DataTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
在试用了更多样式选项后,我找到了一个似乎有效的解决方案。我会 post 它作为可能遇到相同需求的人的答案。 XAML 的代码是:
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="TextBox">
<Setter Property="SpellCheck.IsEnabled" Value="True"/>
</Style>
</DataGridTextColumn.EditingElementStyle>