Hi good morning, I need help with the design and how to implement a custom filter. If you can help me with a small example, I have been reading the "Custom Filtering Controls" documentation (https://docs.telerik.com/devtools/wpf/controls/radgridview/filtering/custom-filtering-controls) but I am having trouble implementing it for this case.
Currently I have a RadGridView, which shows a list of orders. One of the columns shows a list of icons:
public required List<IMvvmViewModel?> DesignStatusViewModels { get; set; }
Column:
<telerik:GridViewDataColumn.Header>
<TextBlock
Text="Design Status"
MinWidth="100"
Width="Auto"
TextAlignment="Center">
</TextBlock>
</telerik:GridViewDataColumn.Header>
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<ItemsControl ItemsSource="{Binding DesignStatusViewModels}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel
Orientation="Horizontal"
HorizontalAlignment="Right"
TextElement.FontSize="12"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentPresenter
Grid.Row="0"
Content="{Binding }"
VerticalAlignment="Center"
ContentTemplateSelector="{StaticResource DesignStatusContentTemplateSelector}"
Margin="2,0,2,0"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
Each IMvvmViewModel has a bool, and a template, the template is responsible for showing the activated or not activated icon for each case, for example:
[ ]
publicpartialclassDesignStatusRushOrderViewModel : IMvvmViewModel
{
publicbool IsRush { get; set;}
}
[ ]
publicpartialclassDesignStatusExternalOrderViewModel : IMvvmViewModel
{
publicbool IsExternal { get; set;}
}
What I need is to make a custom filter for this column, which can filter with a checkbox or whatever is easier, for example all orders that have DesignStatusRushOrderViewModel -> IsRush == true.
Thank you very much! Juan