1 Star 0 Fork 0

QianXun-Studio / Grid.Blazor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Filtering.md 2.27 KB
一键复制 编辑 原始数据 按行查看 历史

Blazor client-side with OData back-end

Filtering

Index

You can enable the filtering option for your columns. To enable this functionality use the Filterable method of the Column object:

    Columns.Add(o => o.Customers.CompanyName)
        .Titled("Company Name")
        .Filterable(true)
        .Width(220);

After that you can filter this column.

You can enable filtering for all columns of a grid using the Filterable method for the GridODataClient object:

    var client = new GridODataClient<Order>(httpClient, url, query, false, "ordersGrid", columns, 10, locale)
        .Filterable();

You can enable a button to clear all selected filters using the ClearFiltersButton method of the GridODataClient object:

    var client = new GridODataClient<Order>(httpClient, url, query, false, "ordersGrid", columns, 10)
        .ClearFiltersButton(true);

GridBlazor supports several types of columns (specified in the Add method):

  • System.String
  • System.Guid
  • System.Int32
  • System.Int64
  • System.Boolean
  • System.DateTime
  • System.Decimal
  • System.Byte
  • System.Double
  • System.Single
  • enum

It also supports nullable types of any element of the list.

GridBlazor has different filter widgets for these types:

  • TextFitlerWidget: it provides a filter interface for text columns (System.String). This means that if your column has text data, GridBlazor will render an specific filter interface:

  • NumberFilterWidget: it provides a filter interface for number columns (System.Int32, System.Decimal etc.)

  • BooleanFilterWidget: it provides a filter interface for boolean columns (System.Boolean):

  • DateTimeFilterWidget: it provides a filter interface for datetime columns (System.DateTime):

Multiple filters

Pressing the + and - buttons you can add multiple options to filter. You can also select the condition you want to use, either And or Or:

You can also create your own filter widgets.

<- Searching | Using a list filter->

1
https://gitee.com/fan0217/Grid.Blazor.git
git@gitee.com:fan0217/Grid.Blazor.git
fan0217
Grid.Blazor
Grid.Blazor
master

搜索帮助