FilterValue.CreateShowBlanksValue(GridViewDataColumn, String) Method
In This Article
Creates and returns the (Blanks) filter item used to filter a column by blank values.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
public static FilterValue CreateShowBlanksValue(
GridViewDataColumn column,
string text
)
#Parameters
Name | Type | Description |
---|---|---|
column | Grid |
A Grid |
text | String | A String value that specifies the item’s display text. |
#Returns
Type | Description |
---|---|
Filter |
Returns the filter item used to filter by blank values. |
#Remarks
When creating custom filter values by handling the ASPxGridView.HeaderFilterFillItems event, you can use the CreateShowBlanksValue method to create the (Blanks) filter item. The created item can be added to a header filter using the event argument’s ASPxGridHeaderFilterEventArgs.AddValue method.
#Example
using DevExpress.Web.ASPxGridView;
...
protected void ASPxGridView1_HeaderFilterFillItems(object sender, DevExpress.Web.ASPxGridViewHeaderFilterEventArgs e) {
e.Values.Clear();
FilterValue showAllItem = FilterValue.CreateShowAllValue("Show All");
e.Values.Add(showAllItem);
FilterValue showBlanksItem = FilterValue.CreateShowBlanksValue(e.Column, "Show Blanks");
e.Values.Add(showBlanksItem);
FilterValue showNonBlanksItem = FilterValue.CreateShowNonBlanksValue(e.Column, "Show non Blanks");
e.Values.Add(showNonBlanksItem);
...
}
See Also