我有一个绑定到 Observable Members 集合的数据网格。现在我想通过输入成员名称在数据网格中查找成员。我试过 IsTextSearchEnable 属性,但它没有搜索。这是我的 xaml。
<DataGrid Name="dgOtherCharges" AutoGenerateColumns="False" RowHeight="25" Grid.Row="4" AlternatingRowBackground="{StaticResource AlternateRowBackgroundBrush}" Grid.ColumnSpan="3" IsTextSearchEnabled="True" TextSearch.Text="Name"
CanUserAddRows="False" HeadersVisibility="Column" SelectionUnit="Cell" ItemsSource="{Binding Path=MembersCollection,Mode=TwoWay}" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
VerticalGridLinesBrush="{StaticResource GridLineColorBrush}" HorizontalGridLinesBrush="{StaticResource GridLineColorBrush}">
<DataGrid.Resources>
<Style TargetType="{x:Type DataGridCell}">
<Style.Triggers>
<Trigger Property="DataGridCell.IsSelected" Value="True">
<Setter Property="Background" Value="{StaticResource ButtonSelectedBrush}" />
<Setter Property="BorderBrush" Value="#A8E3FC" />
<Setter Property="Foreground" Value="Black" />
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridCheckBoxColumn Binding="{Binding IsCheck,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="50">
<DataGridCheckBoxColumn.ElementStyle>
<Style TargetType="CheckBox">
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</DataGridCheckBoxColumn.ElementStyle>
</DataGridCheckBoxColumn>
<DataGridTextColumn Header="Member Name" Binding="{Binding Name,Mode=TwoWay}" IsReadOnly="True" Width="*"/>
</DataGrid.Columns>
</DataGrid>
我需要一个快速的解决方案