Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Change Scrollbar Background Color?

Sort Posts: Previous Next
  •  05-08-2008, 7:19 PM Post no. 12114

    Change Scrollbar Background Color?

    Is it possible to change the background color, foreground color, thumb image, or up/down button image for the scrollbar? I'm able to do this pretty easily with standard WPF controls (i.e. ListBox) by overriding the scrollbar template. Is this possible with the Xceed control?

     It's important that I be able to make the look and feel of the scrollbar blend in with the rest of the grid.

  •  05-10-2008, 2:46 AM Post no. 12145 in reply to 12114

    Re: Change Scrollbar Background Color?

    It's not easy to change the scrollbars style. I've tried with those long time ago but there's not a properly solution. By default, if you use theme in DataGrid, ScrollBars is define in theme. My work around is define another custom theme by create another theme project and define every part of the grid, then i can define my custom scrollbars styles.

     Still waiting for Xceed guys for this issue.

  •  06-11-2008, 9:04 AM Post no. 12862 in reply to 12114

    Re: Change Scrollbar Background Color?

    David:

    Is it possible to change the background color, foreground color, thumb image, or up/down button image for the scrollbar? I'm able to do this pretty easily with standard WPF controls (i.e. ListBox) by overriding the scrollbar template. Is this possible with the Xceed control?

     It's important that I be able to make the look and feel of the scrollbar blend in with the rest of the grid.

     

    Anyone found a solution for this ???

    I also have the same problem, I have my overriding  scrollbar template  , but the scrollbar of the xceed gridcontrol doesn't change. How can I contain my style in the xceed datagrid control?

  •  06-11-2008, 9:14 AM Post no. 12864 in reply to 12862

    Re: Change Scrollbar Background Color?

    Hello, have you guys tried putting your ressources to the grid's level? For example :

    <xcdg:DataGridControl ItemsSource="{Binding Source={StaticResource rssFeed}}"
                                x:Name="grid">
             <xcdg:DataGridControl.Resources>
                <Style TargetType="ScrollBar">
                   <!--<Setter Property="Background"
                           Value="Red" />-->
                   <Setter Property="Template">
                      <Setter.Value>
                         <ControlTemplate>
                            ...
                         </ControlTemplate>
                      </Setter.Value>
                   </Setter>
                </Style>

     This worked fine on my end.
         


    Mathieu Drimonakos
    -Technical Designer-
  •  06-11-2008, 9:32 AM Post no. 12865 in reply to 12864

    Re: Change Scrollbar Background Color?

    it works, but I wish to have some other solution which isn't in the resources of the grid, because once I decide to change the entire look of my application( - i.e. skin change) I wish (on run time) to change only one resource dictionary (where all my styles,templates,overrides are written)

    any other suggestions?

  •  06-11-2008, 10:02 AM Post no. 12866 in reply to 12865

    Re: Change Scrollbar Background Color?

    Yes, currently if you wish to work with a global implicit style it will not work. This is because at the Grid level we redo the scrollviewer for a GridScrollViewer which will override "higher" level styles. I will keep in mind your request however for future versions of the control.


    Mathieu Drimonakos
    -Technical Designer-
  •  06-16-2008, 5:26 AM Post no. 12981 in reply to 12866

    Re: Change Scrollbar Background Color?

    Hi,

    What I suggest is, you keep the style within the DataGridControl.Resources, but link the ControlTemplate to a StaticResource that can be held in an external Resource file.

    < xcdg : DataGridControl.Resources >
     <Style TargetType="ScrollBar">
       <Setter Property="Template" Value="{StaticResource myScrollBarTemplate}"/>
     
    </Style>
    </xcdg:DataGridControl.Resources>

    And you can define myScrollBarTemplate in any resource file that is being refernced in this class

    < ControlTemplate x : Key ="myScrollBarTemplate">
        
    <!-- Define your template here -->
    </ ControlTemplate >

    This way you can define your myScrollBarTemplate differently in different resource files based on the selection of theme.
    The grid in-fact continue to use myScrollBarTemplate  to render its scrollbar, but the definition of myScrollBarTemplate  keeps on changing based on the theme.

    I've tested it at my end before posting, hope it will work for you also. 


    Abdullah Ansari
    Senior Software Engineer
    Outworks Solutions Private Limited

    Everything is okay in the end. If its not okay, then its not the end.
  •  08-14-2008, 6:47 PM Post no. 14083 in reply to 12981

    Re: Change Scrollbar Background Color?

    On a related note, I'd like to refer to different scrollbar styles that we've defined within our application for different parts of the grid. For example, I've used the following syntax to successfully change the scrollbars used within the entire grid:

    <xcdg:DataGridControl.Resources>
        <Style TargetType="ScrollBar" BasedOn="{StaticResource MyScrollBarTemplate}" />
    </xcdg:DataGridControl.Resources>

    However, I would like to use a different scroll bar style for another grid component - specifically within the AutoFilterControl. I can't seem to figure out a way to override which external style is used for that component only - it seems to always hold onto the one defined in the code above. Any ideas?

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.