blazorbootstrap icon indicating copy to clipboard operation
blazorbootstrap copied to clipboard

`FilterOperator.DoesNotContain` Does Not Work `!*ExcludeThis*`

Open mavaddat opened this issue 5 months ago • 0 comments

Describe the bug

The FilterOperator.DoesNotContain filter has no effect even when paired with !*ExcludeThis* filter syntax.

To Reproduce

Steps to reproduce the behavior:

  1. Use FilterOperator="FilterOperator.DoesNotContain" with FilterValue="!*Example*" or FilterValue="*Example*" within a GridColumn of a Grid
  2. See that the filter actually defaults to FilterOperator.None behavior.

Expected behavior

That columns with the expected text would be hidden.

Screenshots

csdbmigration

Versions (please complete the following information):

  • BlazorBootstrap: 1.10.5
  • Blazor WebAssembly / Server: MAUI Blazor Hybrid
  • .NET Version: .NET 8

Sample code

@page "/sgml-to-xml"
@inject SgmlToXmlViewModel ViewModel
<h3>SGML to XML</h3>
<Switch @bind-Value="ViewModel.ByFolder" Label="Choose SGML's by Folder"/>
@if (ViewModel.ByFolder)
{
    <Button TooltipTitle="The program will recursively search for SGML files in the selected folder" Color="ButtonColor.Secondary" @onclick="ViewModel.SelectFolder"> Select Folder </Button>
    ViewModel.EmptyText = "No SGML folder(s) chosen";
}
else
{
    <Button Color="ButtonColor.Secondary" @onclick="ViewModel.SelectSgmlFiles"> Select SGML Files </Button>
    ViewModel.EmptyText = "No SGML file(s) chosen";
}

<Grid AllowFiltering="true" AllowPaging="true" AllowSelection="true" AllowSorting="true" class="table table-hover table-bordered table-striped" Data="ViewModel.SgmlFiles" EmptyText="@ViewModel.EmptyText" ItemsPerPageText="Sgml files per page" PageSize="5" PageSizeSelectorItems="[10, 20, 50]" PaginationAlignment="Alignment.End" PaginationItemsTextFormat="{0} - {1} of {2} files" @ref="ViewModel.SgmlFilesGrid" Responsive="true" SelectedItemsChanged="ViewModel.OnSelectedSgmlFilesChanged" SelectionMode="GridSelectionMode.Multiple" TItem="FileInfo">
    <GridColumn FilterOperator="FilterOperator.DoesNotContain" FilterValue="!*Pool*" HeaderText="Filename" PropertyName="Name" StringComparison="StringComparison.OrdinalIgnoreCase" TItem="FileInfo">
        @context.Name
    </GridColumn>
    <GridColumn HeaderText="Path" TItem="FileInfo">
        <span class="base-path">@Path.GetDirectoryName(Path.GetDirectoryName(context.FullName))</span><span class="leaf-path">@[email protected](Path.GetDirectoryName(context.FullName))</span>
    </GridColumn>
    <GridColumn HeaderText="Last modified" SortKeySelector="item => item.LastWriteTime" TItem="FileInfo">
        @context.LastWriteTime
    </GridColumn>
    <GridColumn HeaderText="Size" SortKeySelector="item => item.Length" TItem="FileInfo">
        @context.Length
    </GridColumn>
</Grid>
<Button Disabled="@(!ViewModel.ConvertIsEnabled)" TooltipTitle="@ViewModel.ConvertTooltip" Color="ButtonColor.Primary" @onclick="ViewModel.Convert"> Convert </Button>

GitHub repo

https://github.com/Technical-Publications-Bombardier/CsdbMigration/

Desktop (please complete the following information):

  • OS: Windows 10 x64

mavaddat avatar Jan 07 '24 09:01 mavaddat