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

RAD Pivot Field List - Background color

8 Answers 94 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
hamish
Top achievements
Rank 1
hamish asked on 16 Jun 2014, 05:32 PM
How can I set the background color to the Pivot field selection list to a color other than white. For example if I use the OFFICE2013 Theme and set my  window background to black and foreground to white (we need a white on black effect) then the Pivot grid field select list has a white background and white foreground hence the fields disappear. How can I change the color of JUST the field select list (i.e. the control titled 'Choose fields to add to report') to something other than white. The 4 select lists at the base of the screen style correctly i.e. a black background and white foreground)

Thank you

8 Answers, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 17 Jun 2014, 10:57 AM
Hello Hamis,

Please check the code spinet below which demonstrates how to modify the Pivot Grid field list background:

<Style  TargetType="pivot:TreeGrid" BasedOn="{StaticResource TableBaseStyle}">
    <Setter Property="Background" Value="Black" />
</Style>

I hope it helps.

Regards,
Masha
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
hamish
Top achievements
Rank 1
answered on 17 Jun 2014, 06:28 PM
Than you that seems to work. Another question is how do I change the alignment of the column header cells in the RadPivotGrid. I want them right justified or centered - how do I achieve this?
0
Masha
Telerik team
answered on 18 Jun 2014, 07:28 AM
Hi Hamish,

You need to modify the PivotHeaderStyle's HorizontalAlignment property to achieve the described approach:

<Style TargetType="pivot:PivotHeader" BasedOn="{StaticResource PivotHeaderStyle}">
    <Setter Property="HorizontalAlignment" Value="Center" />
</Style>

Please note that if PivotHeader has more SubHeaders it will be centered to the size of the first column.

Regards,
Masha
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
hamish
Top achievements
Rank 1
answered on 18 Jun 2014, 01:25 PM
Thanks but HorizontalAlignment property does not seem to make any difference. I put your code in under UserControl.Resources.

Also the compiler generates an error

"The resource 'PivotHeaderStyle' could not be resolved."

I tried it without the BasedOn field and it made no difference - what am I missing?

Thank you
0
hamish
Top achievements
Rank 1
answered on 18 Jun 2014, 01:49 PM
In fact looking at this what it appears to have done is centered the 'Row headings' (i.e. the ones marked in yellow on the attached image). In fact I want to center (or right align) the column headings (the ones marked in red on the attached image)

Thank you
0
Masha
Telerik team
answered on 19 Jun 2014, 08:00 AM
Hi Hamish,

I've attached a sample projects which demonstrated how to align PivotColumnHeaders in RadPivotGrid. I've used the approach described in my previous post. Please notice you need to use implicit style (NoXaml Binaries) in order to Based on to PivotHeaderStyle. If you used Xaml binaries simply removed based on from PivotHeader definition.

I hope this information will be helpful.


Regards,
Masha
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
hamish
Top achievements
Rank 1
answered on 19 Jun 2014, 12:48 PM
Thank you for your reply but I tried to get the example project to work and could not even get it to compile. I tried referencing both the BinariesNoXaml and the regular binaries but still got the same errors -
1. "The Name "SampleOrders" does not exist in namespace....
2. The Tag "NullToVisibilityConverter" does not exist
3. The type reference cannot find a public type named "PivotHeader" (this error appears to be in App.xaml)

Please advise - thank you
0
Masha
Telerik team
answered on 19 Jun 2014, 02:11 PM
Hi Hamish,

It seems that there is an issue with used binaries.
I've attached another project with included binaries in it.

Please download it and give it a try.

Regards,
Masha
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
hamish
Top achievements
Rank 1
Answers by
Masha
Telerik team
hamish
Top achievements
Rank 1
Share this question
or