By default, these buttons are hidden. To show filter buttons, set the Settings.ShowHeaderFilterButton property to true.
The ASPxGridView allows you to create custom filter values, define a filter criteria for them and display these values within a column's filter dropdown. To do this, handle the HeaderFilterFillItems event. In this demo, custom filter values are displayed within the 'Total' and 'Quantity' columns' filter dropdowns.
Loading…
TagPrefix and page properties
<%@ Page Language="C#" MasterPageFile="~/Demo.master" AutoEventWireup="true" CodeFile="HeaderFilter.aspx.cs" Inherits="Summary_Total" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.1" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.1" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phContent" Runat="Server">
<dxwgv:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" DataSourceID="AccessDataSource1" KeyFieldName="OrderID"
OnCustomUnboundColumnData="grid_CustomUnboundColumnData" Width="100%" AutoGenerateColumns="False" OnHeaderFilterFillItems="grid_HeaderFilterFillItems">
<Columns>
Auto Generated Columns
<dxwgv:GridViewDataColumn FieldName="CompanyName" VisibleIndex="0">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="City" VisibleIndex="1">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Region" VisibleIndex="2">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Country" VisibleIndex="3">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Quantity" VisibleIndex="5" Name="Quantity">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataTextColumn FieldName="UnitPrice" VisibleIndex="4">
<PropertiesTextEdit DisplayFormatString="c">
</PropertiesTextEdit>
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn FieldName="Total" VisibleIndex="6" UnboundType="Decimal">
<FooterCellStyle ForeColor="Brown"> </FooterCellStyle>
<PropertiesTextEdit DisplayFormatString="c">
</PropertiesTextEdit>
</dxwgv:GridViewDataTextColumn>
</Columns>
<Settings ShowGroupPanel="True" ShowFooter="True" ShowHeaderFilterButton="true" />
<TotalSummary>
<dxwgv:ASPxSummaryItem FieldName="CompanyName" SummaryType="Count"/>
<dxwgv:ASPxSummaryItem FieldName="Total" SummaryType="Sum" DisplayFormat="c"/>
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Min" />
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Average" />
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Max" />
</TotalSummary>
</dxwgv:ASPxGridView>
DataSource
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/nwind.mdb"
SelectCommand="SELECT [Customers.CompanyName] AS CompanyName, [City], [Region], [Country], [Salesperson], [OrderID], [OrderDate], [ProductID], [ProductName], [UnitPrice], [Quantity], [Discount], [ExtendedPrice], [Freight] FROM [Invoices]">
</asp:AccessDataSource>
</asp:Content>TagPrefix and page properties
<%@ Page Language="C#" MasterPageFile="~/Demo.master" AutoEventWireup="true" CodeFile="HeaderFilter.aspx.cs" Inherits="Summary_Total" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.1" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.1" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phContent" Runat="Server">
<dxwgv:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" DataSourceID="AccessDataSource1" KeyFieldName="OrderID"
OnCustomUnboundColumnData="grid_CustomUnboundColumnData" Width="100%" AutoGenerateColumns="False" OnHeaderFilterFillItems="grid_HeaderFilterFillItems">
<Columns>
Auto Generated Columns
<dxwgv:GridViewDataColumn FieldName="CompanyName" VisibleIndex="0">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="City" VisibleIndex="1">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Region" VisibleIndex="2">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Country" VisibleIndex="3">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Quantity" VisibleIndex="5" Name="Quantity">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataTextColumn FieldName="UnitPrice" VisibleIndex="4">
<PropertiesTextEdit DisplayFormatString="c">
</PropertiesTextEdit>
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn FieldName="Total" VisibleIndex="6" UnboundType="Decimal">
<FooterCellStyle ForeColor="Brown"> </FooterCellStyle>
<PropertiesTextEdit DisplayFormatString="c">
</PropertiesTextEdit>
</dxwgv:GridViewDataTextColumn>
</Columns>
<Settings ShowGroupPanel="True" ShowFooter="True" ShowHeaderFilterButton="true" />
<TotalSummary>
<dxwgv:ASPxSummaryItem FieldName="CompanyName" SummaryType="Count"/>
<dxwgv:ASPxSummaryItem FieldName="Total" SummaryType="Sum" DisplayFormat="c"/>
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Min" />
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Average" />
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Max" />
</TotalSummary>
</dxwgv:ASPxGridView>
DataSource
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/nwind.mdb"
SelectCommand="SELECT [Customers.CompanyName] AS CompanyName, [City], [Region], [Country], [Salesperson], [OrderID], [OrderDate], [ProductID], [ProductName], [UnitPrice], [Quantity], [Discount], [ExtendedPrice], [Freight] FROM [Invoices]">
</asp:AccessDataSource>
</asp:Content>TagPrefix and page properties
<%@ Page Language="C#" MasterPageFile="~/Demo.master" AutoEventWireup="true" CodeFile="HeaderFilter.aspx.cs" Inherits="Summary_Total" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.1" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.1" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phContent" Runat="Server">
<dxwgv:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" DataSourceID="AccessDataSource1" KeyFieldName="OrderID"
OnCustomUnboundColumnData="grid_CustomUnboundColumnData" Width="100%" AutoGenerateColumns="False" OnHeaderFilterFillItems="grid_HeaderFilterFillItems">
<Columns>
Auto Generated Columns
<dxwgv:GridViewDataColumn FieldName="CompanyName" VisibleIndex="0">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="City" VisibleIndex="1">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Region" VisibleIndex="2">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Country" VisibleIndex="3">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Quantity" VisibleIndex="5" Name="Quantity">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataTextColumn FieldName="UnitPrice" VisibleIndex="4">
<PropertiesTextEdit DisplayFormatString="c">
</PropertiesTextEdit>
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn FieldName="Total" VisibleIndex="6" UnboundType="Decimal">
<FooterCellStyle ForeColor="Brown"> </FooterCellStyle>
<PropertiesTextEdit DisplayFormatString="c">
</PropertiesTextEdit>
</dxwgv:GridViewDataTextColumn>
</Columns>
<Settings ShowGroupPanel="True" ShowFooter="True" ShowHeaderFilterButton="true" />
<TotalSummary>
<dxwgv:ASPxSummaryItem FieldName="CompanyName" SummaryType="Count"/>
<dxwgv:ASPxSummaryItem FieldName="Total" SummaryType="Sum" DisplayFormat="c"/>
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Min" />
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Average" />
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Max" />
</TotalSummary>
</dxwgv:ASPxGridView>
DataSource
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/nwind.mdb"
SelectCommand="SELECT [Customers.CompanyName] AS CompanyName, [City], [Region], [Country], [Salesperson], [OrderID], [OrderDate], [ProductID], [ProductName], [UnitPrice], [Quantity], [Discount], [ExtendedPrice], [Freight] FROM [Invoices]">
</asp:AccessDataSource>
</asp:Content>TagPrefix and page properties
<%@ Page Language="C#" MasterPageFile="~/Demo.master" AutoEventWireup="true" CodeFile="HeaderFilter.aspx.cs" Inherits="Summary_Total" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.1" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.1" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phContent" Runat="Server">
<dxwgv:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" DataSourceID="AccessDataSource1" KeyFieldName="OrderID"
OnCustomUnboundColumnData="grid_CustomUnboundColumnData" Width="100%" AutoGenerateColumns="False" OnHeaderFilterFillItems="grid_HeaderFilterFillItems">
<Columns>
Auto Generated Columns
<dxwgv:GridViewDataColumn FieldName="CompanyName" VisibleIndex="0">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="City" VisibleIndex="1">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Region" VisibleIndex="2">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Country" VisibleIndex="3">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Quantity" VisibleIndex="5" Name="Quantity">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataTextColumn FieldName="UnitPrice" VisibleIndex="4">
<PropertiesTextEdit DisplayFormatString="c">
</PropertiesTextEdit>
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn FieldName="Total" VisibleIndex="6" UnboundType="Decimal">
<FooterCellStyle ForeColor="Brown"> </FooterCellStyle>
<PropertiesTextEdit DisplayFormatString="c">
</PropertiesTextEdit>
</dxwgv:GridViewDataTextColumn>
</Columns>
<Settings ShowGroupPanel="True" ShowFooter="True" ShowHeaderFilterButton="true" />
<TotalSummary>
<dxwgv:ASPxSummaryItem FieldName="CompanyName" SummaryType="Count"/>
<dxwgv:ASPxSummaryItem FieldName="Total" SummaryType="Sum" DisplayFormat="c"/>
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Min" />
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Average" />
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Max" />
</TotalSummary>
</dxwgv:ASPxGridView>
DataSource
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/nwind.mdb"
SelectCommand="SELECT [Customers.CompanyName] AS CompanyName, [City], [Region], [Country], [Salesperson], [OrderID], [OrderDate], [ProductID], [ProductName], [UnitPrice], [Quantity], [Discount], [ExtendedPrice], [Freight] FROM [Invoices]">
</asp:AccessDataSource>
</asp:Content>TagPrefix and page properties
<%@ Page Language="C#" MasterPageFile="~/Demo.master" AutoEventWireup="true" CodeFile="HeaderFilter.aspx.cs" Inherits="Summary_Total" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v8.1" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v8.1" Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dxwgv" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phContent" Runat="Server">
<dxwgv:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" DataSourceID="AccessDataSource1" KeyFieldName="OrderID"
OnCustomUnboundColumnData="grid_CustomUnboundColumnData" Width="100%" AutoGenerateColumns="False" OnHeaderFilterFillItems="grid_HeaderFilterFillItems">
<Columns>
Auto Generated Columns
<dxwgv:GridViewDataColumn FieldName="CompanyName" VisibleIndex="0">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="City" VisibleIndex="1">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Region" VisibleIndex="2">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Country" VisibleIndex="3">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataColumn FieldName="Quantity" VisibleIndex="5" Name="Quantity">
</dxwgv:GridViewDataColumn>
<dxwgv:GridViewDataTextColumn FieldName="UnitPrice" VisibleIndex="4">
<PropertiesTextEdit DisplayFormatString="c">
</PropertiesTextEdit>
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn FieldName="Total" VisibleIndex="6" UnboundType="Decimal">
<FooterCellStyle ForeColor="Brown"> </FooterCellStyle>
<PropertiesTextEdit DisplayFormatString="c">
</PropertiesTextEdit>
</dxwgv:GridViewDataTextColumn>
</Columns>
<Settings ShowGroupPanel="True" ShowFooter="True" ShowHeaderFilterButton="true" />
<TotalSummary>
<dxwgv:ASPxSummaryItem FieldName="CompanyName" SummaryType="Count"/>
<dxwgv:ASPxSummaryItem FieldName="Total" SummaryType="Sum" DisplayFormat="c"/>
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Min" />
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Average" />
<dxwgv:ASPxSummaryItem FieldName="Quantity" SummaryType="Max" />
</TotalSummary>
</dxwgv:ASPxGridView>
DataSource
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/nwind.mdb"
SelectCommand="SELECT [Customers.CompanyName] AS CompanyName, [City], [Region], [Country], [Salesperson], [OrderID], [OrderDate], [ProductID], [ProductName], [UnitPrice], [Quantity], [Discount], [ExtendedPrice], [Freight] FROM [Invoices]">
</asp:AccessDataSource>
</asp:Content>