The requested page is not available for the requested platform. You are viewing the content for Default platform.

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
Public Event CustomDisplayText As EventHandler(Of CustomDisplayTextEventArgs)

Event Data

The CustomDisplayText event handler receives an argument of the CustomDisplayTextEventArgs type. 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