Skip to main content

DashboardDesigner.CustomFilterExpression Event

Allows you to include WHERE clauses into DashboardSqlDataSource queries.

Namespace: DevExpress.DashboardWin

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


public event CustomFilterExpressionEventHandler CustomFilterExpression

Event Data

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

Property Description
DataSourceComponentName Get the data source name, used in code to identify the data source’s object, for which the event has been raised.
DataSourceName Gets the name of the data source for which the event has been raised.
FilterExpression Gets or sets the filter expression that defines a WHERE clause included in the SQL query.
QueryName Gets the name of the query for which the event was raised.


The CustomFilterExpression event fires for each SelectQuery within DashboardSqlDataSource (the SqlDataSource.Queries property) and allows you to include a WHERE clause to a query at runtime using the e.FilterExpression event parameter. If filtering is already applied to the SQL query, e.FilterExpression returns a corresponding filter criteria.

For more information on how to create a filter criteria as a CriteriaOperator object, see Simplified Criteria Syntax.


The CustomFilterExpression event is not raised for custom SQL queries and stored procedures.



This example demonstrates API and functionality that is common for the DashboardViewer and DashboardDesigner controls.

This example shows how to handle the DashboardViewer.CustomFilterExpression event to filter an SQL query at runtime. The e.QueryName event parameter is the query name. The e.FilterExpression property specifies the filter criteria.

View Example

using DevExpress.DataAccess;
using DevExpress.Data.Filtering;

namespace Dashboard_CustomFilterExpression_Win {
    public partial class Form1 : DevExpress.XtraEditors.XtraForm {
        public Form1() {

        private void dashboardViewer1_CustomFilterExpression(object sender, CustomFilterExpressionEventArgs e) {
            if (e.DataSourceName == "SQL Data Source 1" && e.TableName == "Invoices") {
                e.FilterExpression = new BinaryOperator("CustomerID","AROUT",BinaryOperatorType.Equal);
See Also