Aspx gridview control Header Filter

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
 <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>

Expand Auto Generated Columns

             <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>

Expand DataSource

 </asp:Content>TagPrefix and page properties
 <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>

Expand Auto Generated Columns

             <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>

Expand DataSource

 </asp:Content>TagPrefix and page properties
 <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>

Expand Auto Generated Columns

             <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>

Expand DataSource

 </asp:Content>TagPrefix and page properties
 <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>

Expand Auto Generated Columns

             <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>

Expand DataSource

 </asp:Content>TagPrefix and page properties
 <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>

Expand Auto Generated Columns

             <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>

Expand DataSource

 </asp:Content>
Ebook Download
View all
Learn
View all