Skip to main content
twblazor
Home
  • Get started
  • Tailwind with Blazor
  • Why twblazor?
  • Theme
  • Class Merge
    • Configuring localization
    • RTL Provider
  • Breadcrumb
  • Card
  • Carousel
  • Collapse
  • Context Menu
  • Drawer
  • Footer
  • Menu
  • Navbar
  • On This Page
  • Separator
  • Sidebar
  • Stepper
  • Tabs
  • Tree List
  • Container
  • Flex
  • Grid
  • Text
  • Link
  • Button
  • Form
    • AutocompleteNew
    • Checkbox
    • Color Picker
    • Date Picker
    • Date Range Picker
    • Datetime Picker
    • Datetime Range Picker
    • File Upload
    • Input GroupNew
    • NumericNew
    • Masked InputNew
    • Radio Button
    • Range SliderNew
    • RatingNew
    • Select
    • Slider
    • Switch
    • Tag InputNew
    • Text EditorNew
    • Textfield
    • Time Picker
    • Time Range Picker
  • Toggle
  • Toggle Group
  • Alert
  • Avatar
  • Badge
  • Chip
  • Empty
  • Icon
  • Popover
  • Progress
  • Skeleton
  • Spinner
  • Tooltip
  • Data Table
  • SpreadsheetNew
  • Column Filter Editor
  • Pagination
  • Pick List
  • Barcode
  • QR Code
  • Calendar
  • Table
  • Attachment
  • Overview
    • Bar
    • Bullet
    • Column
    • Dot Plot
    • Dumbbell
    • Icon
    • Lollipop
    • Radial Bar
    • Range
    • Word Cloud
    • Area
    • Bump
    • Bump Area
    • Candlestick
    • Gantt
    • Horizon
    • Line
    • Slope
    • Small Multiples
    • Stream Graph
    • Funnel
    • Gauge
    • Marimekko
    • Nightingale
    • Pie
    • Treemap
    • Waffle
    • Waterfall
    • Circular Treemap
    • Convex Treemap
    • Dendrogram
    • Sunburst
    • Barcode
    • Beeswarm
    • Box Plot
    • Density Plot
    • Histogram
    • Radial Histogram
    • Ridgeline
    • Strip Plot
    • Violin Plot
    • Categorical Scatter
    • Contour
    • Hexagonal Binning
    • Quadrant
    • Scatter
    • Heatmap
    • Matrix
    • Parallel Coordinates
    • Radar
    • Arc Diagram
    • Chord Diagram
    • Flowchart
    • Network Diagram
    • Sankey
    • Euler Diagram
    • Venn Diagram
  • Bubble
  • Marker
  • Message
  • Dialog Service
  • Toast Service
API DocumentationAI Agents & Skills
Home Get Started

Data

TwColumnFilterEditor

TwColumnFilterEditor edits a column filter of one or two conditions, such as is greater than 100, the same filter TwDataTable and TwSpreadsheet use.

Last updated 9 November 2026

Basic usage

The editor changes a ColumnFilter in place: two conditions, each a comparison and a value, joined by And or Or. It is the filter TwDataTable and the table filters of TwSpreadsheet show, so you can build your own filter UI with the same conditions, for example in a side panel. ColumnFilter.Matches tests a value with the same rules those components use. A condition with no value is ignored, so a new filter lets everything through.
  • Ada Lovelace
  • Alan Turing
  • Grace Hopper
  • Katherine Johnson
  • Linus Torvalds
  • Margaret Hamilton
RAZOR
<div class="grid gap-6 md:grid-cols-2">
    <TwColumnFilterEditor Filter="@nameFilter" OnChange="@StateHasChanged" />
    <ul class="flex flex-col gap-1 text-sm">
        @foreach (var name in names.Where(n => nameFilter.Matches(n)))
        {
            <li>@name</li>
        }
    </ul>
</div>
CSHARP
@code {
    private readonly ColumnFilter nameFilter = new();
    
    private readonly string[] names = ["Ada Lovelace", "Alan Turing", "Grace Hopper", "Katherine Johnson", "Linus Torvalds", "Margaret Hamilton"];
}

Numbers, dates and choices

Type picks the comparisons offered and the field the value is typed into: FilterType.Number offers comparisons such as "is greater than" with a number field, FilterType.Date a date field, and FilterType.Boolean Yes and No. For FilterType.Enum, pass the values to choose from as Choices. Values are kept in one format whatever the culture: numbers with a . and dates as yyyy-MM-dd.
  • ¤24.00
  • ¤39.99
  • ¤120.00
RAZOR
<div class="grid gap-6 md:grid-cols-2">
    <TwColumnFilterEditor Filter="@priceFilter" Type="FilterType.Number" OnChange="@StateHasChanged" />
    <ul class="flex flex-col gap-1 text-sm">
        @foreach (var price in prices.Where(p => priceFilter.Matches(p, FilterType.Number)))
        {
            <li>@price.ToString("C", System.Globalization.CultureInfo.CurrentCulture)</li>
        }
    </ul>
</div>
CSHARP
@code {
    private readonly ColumnFilter priceFilter = new() { First = new() { Operator = FilterOperator.IsGreaterThan, Value = "20" } };
    
    private readonly decimal[] prices = [4.99m, 12.50m, 24m, 39.99m, 120m];
}

Choosing the comparisons

Operators lists the comparisons to offer, in order, in place of the ones that suit the type. The first one is where a new condition starts.

Matches "Shipped": True

RAZOR
<TwColumnFilterEditor Filter="@statusFilter" Type="FilterType.Enum" Operators="@statusOperators" Choices="@statusChoices" OnChange="@StateHasChanged" />
<p class="mt-3 text-sm text-gray-600 dark:text-gray-400">Matches "Shipped": <strong>@statusFilter.Matches("Shipped", FilterType.Enum)</strong></p>
CSHARP
@code {
    private readonly ColumnFilter statusFilter = new() { First = new() { Operator = FilterOperator.IsEqualTo, Value = "Shipped" } };
    
    private readonly FilterOperator[] statusOperators = [FilterOperator.IsEqualTo, FilterOperator.IsNotEqualTo];
    
    private readonly KeyValuePair<string, string>[] statusChoices =
    [
        new("Pending", "Pending"),
        new("Shipped", "Shipped"),
        new("Delivered", "Delivered"),
    ];
}

Accessibility

  • Every field has a visible label: first condition, first value, second condition and second value.
  • The And and Or buttons sit in a labelled group and say which one is chosen with aria-pressed.
  • The fields are the library's own select, numeric and text fields, so they work the same as anywhere else.
  • All of the editor's text is translated into the app's language.

Keyboard navigation

The editor is a set of ordinary fields: each comparison is a list, each value a text, number or date field, and And and Or are two buttons in a labelled group.
Key What it does
Tab or Shift+ plus Tab Moves between the fields and buttons.
Enter or Space or Arrow Down On a comparison list: opens it and moves through the comparisons.
Enter or Space On the And or Or button: chooses how the two conditions combine.

On this page

  • Basic usage
  • Numbers, dates and choices
  • Choosing the comparisons
  • Accessibility
  • Keyboard navigation
twblazor

The Tailwind CSS component library for Blazor. Accessible, themeable and MIT licensed.

Discord (opens in a new tab) GitHub(opens in a new tab)

Get started

  • Install guide
  • Theming
  • Class merging
  • Localization

Guides

  • Tailwind CSS with Blazor
  • Why twblazor?
  • Right to left
  • AI agents and skills

Resources

  • API documentation (opens in a new tab)
  • llms.txt (opens in a new tab)
  • MIT License (opens in a new tab)

Community

  • Contributing (opens in a new tab)
  • Code of conduct (opens in a new tab)
  • Report an issue (opens in a new tab)

twblazor is and always will be free and open source.

An unhandled error has occurred. Reload