1
我是WPF的新手。我有一个约10000行的数据网格。为了实现搜索和突出的功能,下面的代码实现Wpf datagrid滚动条冻结
<Style x:Key="DefaultCell" TargetType="{x:Type DataGridCell}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<local:CustomTextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Content.Text}">
<!--InlineCollection="{Binding ., Converter={StaticResource StringToXamlConverter} }"/>-->
<local:CustomTextBlock.InlineCollection>
<MultiBinding Converter="{StaticResource StringToXamlConverter}">
<Binding RelativeSource="{RelativeSource Self}" Path="." />
<Binding RelativeSource="{RelativeSource Self}" Path="(local:SearchOperations.SearchTerm)"/>
</MultiBinding>
</local:CustomTextBlock.InlineCollection>
</local:CustomTextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
搜索和亮点工作就像一个charm.But上垂直滚动整个电网冻结的点击。这可能是什么原因?
我的猜测是,它运行每个行**转换器**。你可以给它一分钟来试验这个理论吗? –
@MikeEason yes转换器必须通过每个单元才能实现搜索功能。 – subhasmita