Skip to main content
All docs
V23.2

CustomControlProviderBase.Interactivity Property

Gets methods that allow you to configure interactivity settings.

Namespace: DevExpress.DashboardWin

Assembly: DevExpress.Dashboard.v23.2.Win.dll

NuGet Package: DevExpress.Win.Dashboard

Declaration

protected ICustomItemInteractivityProvider Interactivity { get; }

Property Value

Type Description
ICustomItemInteractivityProvider

An object that contains methods to configure interactivity settings.

Remarks

Use the Interactivity property to configure interactivity settings as drill-down or master filter after you supported interactivity for a custom item. To support interactivity, apply SupportInteractivityAttribute to the CustomItemMetadata object’s properties.

The following code snippet uses the Interactivity property’s methods to set the master filter for a custom Funnel item:

The ChartSelectedItemsChanged event occurs every time you click on a Funnel’s value in the UI. The ICustomItemInteractivityProvider.SetMasterFilter(Object) method sets a new selected value, and calls the SetSelection method once the value changes. CustomControlProviderBase.SetSelection(CustomItemSelection) updates a custom control according to the current master filter selection. Every master filter selection change calls the CustomControlProviderBase.SetSelection(CustomItemSelection) method. The UpdateSelectionMode method updates the ChartControl.SelectionMode property according to the actual master filter mode.

using System.Linq;
using System.Windows.Forms;
using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;

namespace TutorialsCustomItems {
  public class FunnelItemControlProvider : CustomControlProviderBase {
    //...
    void ChartSelectedItemsChanged(object sender, SelectedItemsChangedEventArgs e){
        if (chart.SelectedItems.Count == 0 && Interactivity.CanClearMasterFilter)
            Interactivity.ClearMasterFilter();
        else if (Interactivity.CanSetMasterFilter)
            Interactivity.SetMasterFilter(chart.SelectedItems.OfType<DashboardFlatDataSourceRow>());
    }

    void ChartSelectedItemsChanging(object sender, SelectedItemsChangingEventArgs e){
        if (Interactivity.MasterFilterMode == DashboardItemMasterFilterMode.Single && e.NewItems.OfType<DashboardFlatDataSourceRow>().Count() == 0)
            e.Cancel = true;
    }

    protected override void SetSelection(CustomItemSelection selection){
            chart.ClearSelection();
            foreach (DashboardFlatDataSourceRow item in selection.GetDashboardFlatDataSourceRows(flatData))
                chart.SelectedItems.Add(item);
    }

    void UpdateSelectionMode(){
      switch (Interactivity.MasterFilterMode){
          case DashboardItemMasterFilterMode.Single:
              chart.SelectionMode = ElementSelectionMode.Single;
              break;
          case DashboardItemMasterFilterMode.Multiple:
              chart.SelectionMode = ElementSelectionMode.Extended;
              break;
          default:
              chart.SelectionMode = ElementSelectionMode.None;
              break;
        }
    }
  }
}

Refer to the following tutorial for more information on how to configure master filtering and drill-down for a custom Funnel item: Create an Interactive Data-Aware Item.

See Also