Back to Devexpress

DefaultGroupIntervalAttribute Class

dashboard-devexpress-dot-dashboardcommon-2ad404b2.md

latest2.7 KB
Original Source

DefaultGroupIntervalAttribute Class

Specifies the default group interval for data items.

Namespace : DevExpress.DashboardCommon

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

NuGet Package : DevExpress.Dashboard.Core

Declaration

csharp
[AttributeUsage(AttributeTargets.Property)]
public class DefaultGroupIntervalAttribute :
    Attribute
vb
<AttributeUsage(AttributeTargets.Property)>
Public Class DefaultGroupIntervalAttribute
    Inherits Attribute

Remarks

Apply the DefaultGroupIntervalAttribute to a data section in metadata. The attribute allows you to set the default group interval for data items in the section.

To specify the date-time group interval, pass one of the DateTimeGroupInterval enumeration values as an argument to the DefaultGroupIntervalAttribute constructor.

The following code snippet sets the default Month-Year group interval for data items in the Arguments section:

csharp
using System.ComponentModel;
using DevExpress.DashboardCommon;

namespace CustomItemsSample {
  public class CustomFunnelMetadata : CustomItemMetadata {
    //...
    [DefaultGroupInterval(DateTimeGroupInterval.MonthYear)]
    public DimensionCollection Arguments { get; } = new DimensionCollection();
  }
}
vb
Imports System.ComponentModel
Imports DevExpress.DashboardCommon

Namespace CustomItemsSample
  Public Class CustomFunnelMetadata
    Inherits CustomItemMetadata
      '...
      <DefaultGroupInterval(DateTimeGroupInterval.MonthYear)>
      Public ReadOnly Property Arguments() As New DimensionCollection()
  End Class
End Namespace

When a user drops a data item in the Arguments section of the UI, the data item’s initial group interval is automatically set to Month-Year.

Inheritance

Object Attribute DefaultGroupIntervalAttribute

See Also

DefaultGroupIntervalAttribute Members

DevExpress.DashboardCommon Namespace