Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
800
change dimension/measure captions
posted

Hi,


I'd like to ask if it is possible to change the captions of the
measures/dimensions generated automatically by a flatdatasource (based
on an IEnumerable)? So if the flatDataSource.ItemsSource is set to an
IEnumerable and the captions are like "PRDGRP" and "ST_DATE" by
default, then I'd like to display them in the dataselector as "Product
Group" and "Start date". Is it possible to change the captions of the items in the data selector?

Thanks and best regards,

Tamas

Parents
No Data
Reply
  • 8831
    posted

    Hi Tamas,

    You can decorate the properties of your business objects’ class with DisplayAttribute and set its Name property and this value will be displayed in the UI of the pivot grid.

    [DisplayAttribute(Name = "Product Group")]

    public string ProductGroup

    {

        get;

        set;

    }

     

    Note that there is an option also to set display format for the measures. In this case you set DisplayFormatAttribute:

    [DisplayFormat(DataFormatString = "{0:C2}")]

    public double Cost

    {

        get;

        set;

    }

     

    If you want to do that within XAML you have to add a new CubeMetadata object to FlatDataSource.CubeSettings collection and then have to add DimensionMetadata object for each property:

    <!—Overrides the default meta attributes -->

    <FlatData:FlatDataSource.CubesSettings>

        <FlatData:CubeMetadata DataTypeFullName="[Your data type full name]" DisplayName="[The UI name of the cube]">

            <FlatData:DimensionMetadata SourcePropertyName="ProductGroup" DisplayName="Product Group"/>

        </FlatData:CubeMetadata>

    </FlatData:FlatDataSource.CubesSettings>

     

    I hope that covers your needs.

     

    Regards.

    PPilev.

Children