Skip to main content

DashboardItemState.RangeFilterState Property

Gets or sets the state of the Range Filter and Date Filter dashboard items.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v24.2.Core.dll

Declaration

public RangeFilterState RangeFilterState { get; set; }

Property Value

Type Description
RangeFilterState

A RangeFilterState object that specifies the state of the Range Filter and Date Filter dashboard items.

Remarks

A Range Filter can use both a range of values ​​and predefined periods.

The following code snippet adds Range Filter state values to the entire dashboard state (DashboardState):

public DashboardState CreateDashboardState() {
  DashboardState state = new DashboardState();
  // Set a range for a Range Filter.
    state.Items.Add(new DashboardItemState("rangeFilterDashboardItem1") {
    RangeFilterState = new RangeFilterState(new RangeFilterSelection(new DateTime(2015, 1, 1), new DateTime(2017, 1, 1)))
    });
  return state;
}            

The following code snippet adds a predefined period of the Range Filter state to the entire dashboard state:

public DashboardState CreateDashboardState() {
  DashboardState state = new DashboardState();
  // Set a predefined period for a Range Filter.
    state.Items.Add(new DashboardItemState("rangeFilterDashboardItem1") {
    RangeFilterState = new RangeFilterState(periodName: "6 month")
    });
  return state;
} 

The following code snippet clears states (unselects all values) of the Range Filter and Date Filter dashboard items:

protected void ASPxDashboard1_SetInitialDashboardState(object sender, SetInitialDashboardStateEventArgs e) {
  var state = new DashboardState();
    // ...
  state.Items.Add(new DashboardItemState("rangeFilterDashboardItem1"){
      RangeFilterState = new RangeFilterState()
  });
  state.Items.Add(new DashboardItemState("dateFilterDashboardItem1"){
      RangeFilterState = new RangeFilterState()
  });
  // ...
  e.InitialState = state
} 

See the following topics for details on how to assign a dashboard state to a Dashboard control:

See Also