Skip to main content
Tab

ASPxFileManager.DetailsViewCustomColumnHeaderFilterFillItems Event

Enables you to provide custom filter items displayed within a filter dropdown for a custom column.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.1.dll

NuGet Package: DevExpress.Web

Declaration

public event FileManagerDetailsViewCustomColumnHeaderFilterFillItemsEventHandler DetailsViewCustomColumnHeaderFilterFillItems

Event Data

The DetailsViewCustomColumnHeaderFilterFillItems event's data class is FileManagerDetailsViewCustomColumnHeaderFilterFillItemsEventArgs. The following properties provide information specific to this event:

Property Description
Column Gets the custom column currently being filtered.
Values Gets the filter values.

The event data class exposes the following methods:

Method Description
AddShowAll() Adds the All item to the header filter of a custom column.
AddValue(String, String, String) Adds a new filter item with the specified filter criteria to the column header filter.
AddValue(String, String) Adds a new filter item to the column header filter.

Remarks

A custom column’s header filter availability is controlled by the FileManagerDetailsCustomColumn.ShowHeaderFilterButton property. By default the header filter displays a list of available column cell values and All, Blanks, and Non blanks items.

Use the DetailsViewCustomColumnHeaderFilterFillItems event to provide custom header filter items. The FileManagerDetailsViewCustomColumnHeaderFilterFillItemsEventArgs.Column event argument property determines the custom column currently being filtered. The FileManagerDetailsViewCustomColumnHeaderFilterFillItemsEventArgs.Values property lists the header filter values.

You can clear the default items using the Clear method. The FileManagerDetailsViewCustomColumnHeaderFilterFillItemsEventArgs.AddShowAll method allows you to add the All item to the header filter. To add a custom filter value to the FileManagerDetailsViewCustomColumnHeaderFilterFillItemsEventArgs.Values list, use one of the FileManagerDetailsViewCustomColumnHeaderFilterFillItemsEventArgs.AddValue overloads.

To learn more about custom columns, see the Custom Columns topic.

Example

This code sample demonstrates how to populate a custom column’s header filter with custom items. For this purpose, the ASPxFileManager.DetailsViewCustomColumnHeaderFilterFillItems event is handled.

FileManager_CustomHeaderFilter

View Example

<dx:ASPxFileManager ID="ASPxFileManager1" runat="server" Width="800px" Height="400px" OnDetailsViewCustomColumnDisplayText="ASPxFileManager1_DetailsViewCustomColumnDisplayText" OnDetailsViewCustomColumnHeaderFilterFillItems="ASPxFileManager1_DetailsViewCustomColumnHeaderFilterFillItems">
    <Settings RootFolder="~\Files\" ThumbnailFolder="~\Thumb\" />
    <SettingsFileList View="Details">
        <DetailsViewSettings>
            <Columns>
                <dx:FileManagerDetailsColumn Caption=" " FileInfoType="Thumbnail" VisibleIndex="0">
                </dx:FileManagerDetailsColumn>
                <dx:FileManagerDetailsColumn Caption="Name" VisibleIndex="1">
                </dx:FileManagerDetailsColumn>
                <dx:FileManagerDetailsCustomColumn Caption="Extension" Name="FileExtension" VisibleIndex="2" ShowHeaderFilterButton="True">
                </dx:FileManagerDetailsCustomColumn>
            </Columns>
        </DetailsViewSettings>
    </SettingsFileList>
</dx:ASPxFileManager>
protected void ASPxFileManager1_DetailsViewCustomColumnHeaderFilterFillItems(object source, DevExpress.Web.FileManagerDetailsViewCustomColumnHeaderFilterFillItemsEventArgs e) {
    if (e.Column.Name != "FileExtension") return;
    e.Values.Clear();
    e.AddShowAll();
    e.AddValue("Media Files", string.Empty, "FileExtension = 'avi' or FileExtension = 'mp3' or FileExtension = 'jpg'");
    e.AddValue("Documents", string.Empty, "FileExtension = 'txt' or FileExtension = 'rtf' or FileExtension = 'xml'");
    e.AddValue("Photos", "jpg");
}
See Also