RAD Pivot Field List - Background color

9 posts, 0 answers
  1. hamish
    hamish avatar
    44 posts
    Member since:
    Jun 2007

    Posted 16 Jun 2014 Link to this post

    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
  2. Masha
    Admin
    Masha avatar
    355 posts

    Posted 17 Jun 2014 Link to this post

    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.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. hamish
    hamish avatar
    44 posts
    Member since:
    Jun 2007

    Posted 17 Jun 2014 in reply to Masha Link to this post

    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?
  5. Masha
    Admin
    Masha avatar
    355 posts

    Posted 18 Jun 2014 Link to this post

    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.
     
  6. hamish
    hamish avatar
    44 posts
    Member since:
    Jun 2007

    Posted 18 Jun 2014 in reply to Masha Link to this post

    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
  7. hamish
    hamish avatar
    44 posts
    Member since:
    Jun 2007

    Posted 18 Jun 2014 in reply to hamish Link to this post

    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
  8. Masha
    Admin
    Masha avatar
    355 posts

    Posted 19 Jun 2014 Link to this post

    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.
     
  9. hamish
    hamish avatar
    44 posts
    Member since:
    Jun 2007

    Posted 19 Jun 2014 in reply to Masha Link to this post

    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
  10. Masha
    Admin
    Masha avatar
    355 posts

    Posted 19 Jun 2014 Link to this post

    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.
     
Back to Top
UI for WPF is Visual Studio 2017 Ready