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
1750
How to Set Cell Format in runtime
posted

Hi,

I use Setters in c# to set various formatting in pivotGrid cells.

p.e.

           // CellStyle.BorderBrush

            _Setter = new Setter();

            _Setter.Property = BorderBrushProperty;

            _Setter.Value = ControlProperties["CellStyle.BorderBrush"].Data;

            pivotGrid.CellStyle.Setters.Add(_Setter);

How can I change the default format the same way ?
p.e. to set it  " ## {0}"
Thank u

Parents
No Data
Reply
  • 7922
    posted

    Hi

    To apply diferent format you should do this when you define your measures. The cell style does not support such property where you can define the new format.

    When you define your measures then you should suply and DisplayFormat string like below:

    cubeMetadata.DimensionSettings.Add(new DimensionMetadata()
    {
        SourcePropertyName = "LYUnits",
        DisplayName = "LY Units",
        //DisplayFormat = "{0:N0}"
        DisplayFormat = "##{0}"
    });

    In 11.1 version which will come frist week of June, we have added such property to the grid

    Regards

Children