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

Hiding Fields in PivotFieldList

3 Answers 122 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 20 May 2014, 06:39 PM
PivotGrid is absolutely amazing. One issue we are running into, however, is the PivotFieldList displays all the properties of the objects in the collection. Is there a way, similar to RadGridView, to hide or prevent certain fields from appearing in the list? There is very little documentation on it. Is the only solution to create a DTO object that exposes only the properties you want?

3 Answers, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 20 May 2014, 07:17 PM
Hi Steven,

Thank you for your kind words. We are really happy when our customers are satisfied by our controls.

As per your question, you can use Data Annotations similar to  RadGridView - just mark the public properties that you do not want to show with Display attribute and set AutoGenerateField to false:
//Hide Product from the UI
[Display (AutoGenerateField=false)]
public string Product { get; set; }

You can find more information how to use Data Annotations with RadPivotFieldList and RadPivotGrid in our online help.

Feel free to contact us in case you have any problems or concerns.

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Steven
Top achievements
Rank 1
answered on 21 May 2014, 12:39 PM
Rosen,

Thanks for this, I did see the DataAnnotations option but it seems, at least in the docs, to be for the LocalDataSourceProvider only. I should have mentioned we are using the Queryable Data Provider and entity classes that are auto-generated by EntityFramework so they include fields like the primary key, relational keys, etc - stuff we wouldn't expose to a customer and want to hide.

In any case, we decided to use DTO objects to translate the raw POCO class into a slimmed down class that only exposes the properties we want, so that works OK. An added benefit is we can add other fields to the DTO as well for additional reporting and slicing.

I was hoping there was a XAML option like with RadGridView where you could list the fields you want to expose in the RadPivotFieldList and then mark some as IsVisible = false (again, like the excellent RadGridView).

Thanks!

Steve

0
Rosen Vladimirov
Telerik team
answered on 22 May 2014, 06:32 AM
Hi Steve,

I'm glad you have resolved the issue and thank you for the valuable feedback. You can add your feature request for adding a XAML option to filter the fields, in our feedback portal, so other customers will be able to vote for it.

You can use Data Annotations with QueryableDataProvider (we'll update our documentation for this option), by adding the annotations to your entity classes.

Feel free to contact us in case you have any problems or concerns.

Regards,
Rosen Vladimirov
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
PivotGrid
Asked by
Steven
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
Steven
Top achievements
Rank 1
Share this question
or