Back to Devexpress

SupportedDataTypesAttribute Class

dashboard-devexpress-dot-dashboardcommon-a9cd722f.md

latest3.0 KB
Original Source

SupportedDataTypesAttribute Class

Specifies types of data fields that can be used for data items in a section.

Namespace : DevExpress.DashboardCommon

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

NuGet Package : DevExpress.Dashboard.Core

Declaration

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

Remarks

You can apply SupportedDataTypesAttribute to a data section when you create metadata for a custom dashboard item. The attribute identifies the data field type that a user can add to a section.

To specify the data field type, pass one of the DataSourceFieldType enumeration values as an argument to the SupportedDataTypesAttribute constructor.

The following code snippet specifies that data items in the Value section should have the integer type. As a result, you can add only an integer data field in this section.

csharp
using System.ComponentModel;
using DevExpress.DashboardCommon;

namespace CustomItemsSample {
  public class CustomFunnelMetadata : CustomItemMetadata {
    [DisplayName("Value"),
    EmptyDataItemPlaceholder("Value"),
    SupportedDataTypes(DataSourceFieldType.Integer)]
    public Measure Value
    {
        get { return GetPropertyValue<Measure>(); }
        set { SetPropertyValue(value); }
    }
    //...
}
vb
Imports System.ComponentModel
Imports DevExpress.DashboardCommon

Namespace CustomItemsSample
  Public Class CustomFunnelMetadata
      Inherits CustomItemMetadata
      <DisplayName("Value"), EmptyDataItemPlaceholder("Value"), SupportedDataTypes(DataSourceFieldType.Integer)> _
      Public Property Value() As Measure
          Get
              Return GetPropertyValue(Of Measure)()
          End Get
          Set(ByVal value As Measure)
              SetPropertyValue(value)
          End Set
      End Property
  '...
  End Class
End Namespace

Inheritance

Object Attribute SupportedDataTypesAttribute

See Also

SupportedDataTypesAttribute Members

DevExpress.DashboardCommon Namespace