Hi,
i would like to change the Field Displayname of Properties used in the Pivot-Fieldlist.
I tryed to use the AddingContainerNode Event from LocalDataSourceFieldDescriptionsProvider, but it's only possible to change the
display name like
(e.ContainerInfo as PropertyInfoFieldInfo).DisplayName = "Test"
This works for the aggregate list, but in List of fields there is always the name of property visible.
I tryed to change also the caption of ContainerNode but there is no Setter implemented.
e.ContainerNode.Caption ="Test"; //it's not possible, but ist seems to be there right way
Is there another way to Change the Caption.
Thanks for help.
Best regards
Stephan
6 Answers, 1 is accepted
If you are using LocalDataSourceProvider, in order to change the name used in the RadPivotFieldList for a specific field you can use the Display attribute for this field as explained in this help article: http://docs.telerik.com/devtools/wpf/controls/radpivotgrid/features/localdatasourceprovider/data-annotations
Please give it a try and let us know if it works for you.
Regards,
Polya
Telerik by Progress

Hi,
yes it works. thanks for help.
Regards.
Stephan

Hi, is it possible to do the same with a DataTable or an expando object (dynamic) as ItemSource?
My problem is that I have to create my object runtime.
Thank you
It is not possible to use ExpandoObject as a source for RadPivotGrid. The reason is that reflection doesn't work as expected on dynamic types. LocalDataSourceProvider uses reflection to examine its object's properties, and ExpandoObject doesn't have any (static) properties.
You can convert your ExpandoObject to DataTable at runtime as shown in this thread.
Then you can use the Caption property of each DataColumn added to the DataTable to change the field caption associated with this DataColumn.
Regards,
Polya
Telerik by Progress

I tried adding a Caption for the DataColumn but nothing worked
Hello Konstantin,
I tested this in a sample project on my end and the Caption set to a DataTable column is used in the RadPivotFieldList as intended. That is why I am attaching the sample project that I used for testing purposes.
Can you check it out and see how it differs from the setup on your end? If you need any further assistance, may I ask you to modify the sample project in order to demonstrate the observed on your end scenario and send it back. This will hopefully allow me to investigate further and better assist you.
Regards,
Vladimir Stoyanov
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.