Hi, I use the following code to overwrite the FilteringControl
public class ContainsFilteringControl: FilteringControl
{
public override void Prepare(GridViewColumn gridViewColumn)
{
base.Prepare(gridViewColumn);
var vm = DataContext as FilteringViewModel;
if (vm == null) return;
if (!vm.Filter1.IsActive)
{
vm.Filter1.Operator = FilterOperator.Contains;
}
if (!vm.Filter2.IsActive)
{
vm.Filter2.Operator = FilterOperator.Contains;
}
}
}
Then, in the code behind of the view,
public MyWindow(MyViewModel viewModel)
{
DataContext = viewModel;
this.radGrid.Columns[2].FilteringControl = new ContainsFilteringControl();
}
After recompile and run the application, the filter changes to Contains.
However, when the filter is opened first time, the text boxes below the filter dropdowns are not shown.
When the filter window is opended the second time, the text boxes will appear.
Anything I can do to fix this?
Thanks