This question is locked. New answers and comments are not allowed.
Hello,
By default, grid text column filters are applied with case sensitivity, but I have a requirement to allow users to apply case-insensitive filters. I have already checked out the grid demo (from the Windows store) which filters without case, but the implementation there does not meet my needs. I'd like to use the built-in filtering functionality in the column headers, but not case-sensitive.
I thought I was on the right track by implementing a custom Filter Button Tap Command class:
But the problem here is that it doesn't work on the initial filtering - when the "Filter" button is first clicked, the default case-sensitive filtering is applied. The case-insensitive filtering doesn't apply until the user clicks on the filter button in the column header again, which is not desirable.
Is there a way I can still utilize the built-in filtering functionality but configure it to be case-insensitive?
Thanks!
Geoff
By default, grid text column filters are applied with case sensitivity, but I have a requirement to allow users to apply case-insensitive filters. I have already checked out the grid demo (from the Windows store) which filters without case, but the implementation there does not meet my needs. I'd like to use the built-in filtering functionality in the column headers, but not case-sensitive.
I thought I was on the right track by implementing a custom Filter Button Tap Command class:
public class DynamicFilterButtonTapCommand : DataGridCommand { public DynamicFilterButtonTapCommand() { Id = CommandId.FilterButtonTap; } public override bool CanExecute(object parameter) { return Owner.CommandService.CanExecuteDefaultCommand(Id, parameter); } public override void Execute(object parameter) { base.Execute(parameter); var context = (FilterButtonTapContext)parameter; var textFilter = context.AssociatedDescriptor as TextFilterDescriptor; if (textFilter != null) textFilter.IsCaseSensitive = false; // Executes the default implementation of this command Owner.CommandService.ExecuteDefaultCommand(Id, context); } }But the problem here is that it doesn't work on the initial filtering - when the "Filter" button is first clicked, the default case-sensitive filtering is applied. The case-insensitive filtering doesn't apply until the user clicks on the filter button in the column header again, which is not desirable.
Is there a way I can still utilize the built-in filtering functionality but configure it to be case-insensitive?
Thanks!
Geoff