A newer version of this page is available. Switch to the current version.

DateFilterControl.CustomDisplayText Event

Allows you to specify the date picker text.

Namespace: DevExpress.DashboardWin

Assembly: DevExpress.Dashboard.v19.1.Win.dll

Declaration

public event EventHandler<CustomDisplayTextEventArgs> CustomDisplayText

Event Data

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

Property Description
DisplayText Gets or sets an editor’s display text.
Value Gets an editor’s current value.

Remarks

The CustomDisplayText event fires before a date picker caption is displayed and allows you to change it.

Examples

This code snippet specifies the date picker button’s caption.

NOTE

The complete sample project How to Customize the Date Filter Dashboard Item is available in the DevExpress Examples repository.

using DevExpress.DashboardWin;
using DevExpress.XtraEditors.Controls;
using System;
// ...
    dashboardViewer1.DashboardItemControlCreated += DashboardViewer1_DashboardItemControlCreated;
// ...
    private void DashboardViewer1_DashboardItemControlCreated(object sender, DashboardItemControlEventArgs e)
    {
        if (e.DateFilterControl != null)
        {
            dateFilter.CustomDisplayText += DateFilter_CustomDisplayText;
        }
    }

    private void DateFilter_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
    {
        e.DisplayText = (e.Value is DateTime) ? string.Format("{0:d}", e.Value) : "Click for the Date Picker";
    }
See Also