GridColumnFilterMode Enum
Lists values that specify how to filter grid data.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
public enum GridColumnFilterMode
Members
Name | Description |
---|---|
Value
|
Filters data by value. |
DisplayText
|
Filters data by display text. |
Related API Members
The following properties accept/return GridColumnFilterMode values:
Remarks
The GridColumnFilterMode
enumeration values specify whether grid data is filtered by value or display text.
Filter Data By Value (Default Behavior)
When the FilterMode property is set to Value
, the grid filters rows by cell values.
<DxGrid Data="@Data" CustomizeCellDisplayText="Grid_CustomizeCellDisplayText"
ShowFilterRow="true" PageSize="7">
<Columns>
<DxGridDataColumn FieldName="Date" DisplayFormat="D" />
<DxGridDataColumn FieldName="CloudCover" />
<DxGridDataColumn FieldName="TemperatureC" TextAlignment="GridTextAlignment.Left" Caption="Forecast"
FilterMode="GridColumnFilterMode.Value" />
</Columns>
</DxGrid>
void Grid_CustomizeCellDisplayText(GridCustomizeCellDisplayTextEventArgs e) {
if(e.FieldName == "TemperatureC") {
int val = Convert.ToInt32(e.Value);
if(val < 15)
e.DisplayText = "Cold";
else if(val < 25)
e.DisplayText = "Warm";
else
e.DisplayText = "Hot";
}
}
Filter Data By Display Text
When the FilterMode property is set to DisplayText
, the grid filters rows by display text. This scenario can be useful when you specify custom display text for cells (see the DisplayFormat property and CustomizeCellDisplayText event descriptions).
<DxGrid Data="@Data" CustomizeCellDisplayText="Grid_CustomizeCellDisplayText"
ShowFilterRow="true" PageSize="7">
<Columns>
<DxGridDataColumn FieldName="Date" DisplayFormat="D"
FilterMode="GridColumnFilterMode.DisplayText" />
<DxGridDataColumn FieldName="CloudCover" />
<DxGridDataColumn FieldName="TemperatureC" TextAlignment="GridTextAlignment.Left" Caption="Forecast"
FilterMode="GridColumnFilterMode.DisplayText" />
</Columns>
</DxGrid>
void Grid_CustomizeCellDisplayText(GridCustomizeCellDisplayTextEventArgs e) {
if(e.FieldName == "TemperatureC") {
int val = Convert.ToInt32(e.Value);
if(val < 15)
e.DisplayText = "Cold";
else if(val < 25)
e.DisplayText = "Warm";
else
e.DisplayText = "Hot";
}
}
Limitations
The Grid does not support filtering by display text when you use a Server Mode data source or GridDevExtremeDataSource.