This is a migrated thread and some comments may be shown as answers.

StringFormat Documentation

1 Answer 273 Views
PivotGrid and PivotFieldList
This is a migrated thread and some comments may be shown as answers.
Jens
Top achievements
Rank 1
Jens asked on 14 Sep 2015, 11:23 AM

Hey,

is there any documentation about the "StringFormat" property used by the PropertyAggregateDescription?

Only useful resource i found was for Kendo UI (http://docs.telerik.com/kendo-ui/framework/globalization/numberformatting​).

I have no clue how to set the Format to n0 and add a postfix string (the result should look like 10,045 FOO$). I've tried "n0 'FOO$'", but it keeps ignoring the n (so i dont get any separators). "0 'FOO$'" works, but does not give me the desired number format.

Cheers,

Jens

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Sep 2015, 02:44 PM
Hello Jens,

Thank you for writing back.

You can find useful information about specifying a format for numeric cells in the following help article: Standard Numeric Format Strings. In order to add a specific text next to the numeric value it is appropriate to use the CellFormatting event and set the Text property:
  
private void radPivotGrid1_CellFormatting(object sender, Telerik.WinControls.UI.PivotCellEventArgs e)
{
    if (e.CellElement.Row.Name.Contains("Freight") && e.CellElement.Text != string.Empty)
    {
        e.CellElement.Text = string.Format("{0:n3} FOO$", e.CellElement.Value);
    }
}

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
PivotGrid and PivotFieldList
Asked by
Jens
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or