I can't find where to style the "smallcontent" scrollbar

4 posts, 0 answers
  1. Joel
    Joel avatar
    14 posts
    Member since:
    Aug 2010

    Posted 16 May 2013 Link to this post

    Hi,

    I'm trying to style the scroll bar that allows the user to scroll through the "smallcontent" tiles.  There's a scrollview within the LargeContent tile view and that one picks up the general Scrollbar style properly.  How can I access the scrollbar (marked as "Not picking up style" in the attached image) style?

    I added a screen shot showing the styled scrollbar and the one I can't style.

    Thanks,

    Joel
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 21 May 2013 Link to this post

    Hi Joel,

    In order to achieve your requirement you can extract and edit the default template of the RadTileView control. By doing so you will be able to apply your custom style to the ScrollViewer named "ScrollViewer". You can find more information about how you can extract the template in this article.

    For your convenience I extracted it in the attached project. Please take a look at it and let me know if it works for you.

    All the best,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Joel
    Joel avatar
    14 posts
    Member since:
    Aug 2010

    Posted 23 May 2013 Link to this post

    Hi Pavel,

    Thanks for your reply and example.  Everything worked fine in your example but I still wasn't getting the same behaviour in my application.  After some troubleshooting I found that by disabling the ApplicationTheme used in the control's constructor everything worked as expected.  So for some reason, if an application theme is set, not all controls behave the same (Horizontal ScrollBar compared to Vertical ScrollBar).  For the record and anyone else having the same issue, here is what I did:

    public MyControl()
    {
        Telerik.Windows.Controls.StyleManager.ApplicationTheme = null; // Null the theme before load
      
        InitializeComponent();
      
        Telerik.Windows.Controls.StyleManager.ApplicationTheme = new Windows8TouchTheme(); // Put the theme back to what it was
    }

    Easy as that.  If only I would of known that a day ago.

    :-)

    Thanks,

    -- Joel
  5. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 28 May 2013 Link to this post

    Hi Joel,

    Our style manager is not designed to change the ApplicationTheme at run-time. Hence setting it to null before the InitializeComponent() method, all Telerik's controls will take the default theme (which is Office_Black). Basically we do not guarantee that the ApplicationTheme will be changed as expected if you set it after the InitializeComponent() method using the StyleManager. It is most likely that the theme will not be properly changed or changed partially.

    However, if you need to switch themes at run-time you can use our Implicit Styles in combination with our NoXAML dlls. You can find more information here.

    Regards,
    Pavel R. Pavlov
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top