I have build a custom FilteringControl for my RadGridView and got it to work on the following way:
My custom filtering control implements the IFilteringControl interface.
In our application there are many RadGridViews with many columns, so I want to make a kind of Style with ControlTemplate to force every filter to use my custom filter control, instead of implementing my custom filter control on every column definition.
The way I tried to solve my problem is:
When I press the funnel on the gridview column my custom filter shows up, but the list stays empty. The cause of this is that the Prepare method of the IFilterControl is never called.
What am I doing wrong?
<telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Value" DataMemberBinding="{Binding Path=RowValue}" FilteringControl="{StaticResource ResourceKey=ViFilterControl}" /></telerik:RadGridView.Columns>My custom filtering control implements the IFilteringControl interface.
In our application there are many RadGridViews with many columns, so I want to make a kind of Style with ControlTemplate to force every filter to use my custom filter control, instead of implementing my custom filter control on every column definition.
The way I tried to solve my problem is:
<Style x:Key="FilteringControlStyle" TargetType="telerik:FilteringControl"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Type=telerik:FilteringControl}"> <wpfApplication1:FilterControl /> </ControlTemplate> </Setter.Value> </Setter></Style><Style TargetType="{x:Type Type=telerik:FilteringControl}" BasedOn="{StaticResource ResourceKey=FilteringControlStyle}" />When I press the funnel on the gridview column my custom filter shows up, but the list stays empty. The cause of this is that the Prepare method of the IFilterControl is never called.
What am I doing wrong?