RadTileView and Scrollbar

11 posts, 0 answers
  1. Halász Levente
    Halász Levente avatar
    21 posts
    Member since:
    Feb 2010

    Posted 13 Aug 2010 Link to this post

    Dear Everybody,

    After spending more than 5 hours figuring out how could I make RadTileView not to shrink my tiles but show the scrollbar if needed, I'd like to share some info with you:
    - Reading Kiril Stanoev's article, when he says "If the sum of the minimized heights/widths of all minimized TileViewItems exceeds the available space,RadTileView will show a ScrollBar allowing you to scroll the minimized items." he means MinimizedHeight and MinimizedWidth property of the RadTileViewItem instance. Also this sentence applies only when the TileView state is One (One big item, and the rest is small). It took me a while to figure this out, it might be my bad English, or I'm just a little bit distracted right now, but thought it I mention it, just in case someone else miss understands this. 
    - Also don't apply the Windows7 theme (telerik:StyleManager.Theme="Windows7"), because it'l neutralize you're ItemContainerStyle settings.
    <telerik:RadTileView.ItemContainerStyle>
         <Style TargetType="telerik:RadTileViewItem">
            <Setter Property="MinimizedHeight" Value="300" />
         </Style>
    </telerik:RadTileView.ItemContainerStyle>

     If you must use Windows7 theme (though did not check with the other themes), handle the TilesStateChanged event like this.

    private void tileView1_TilesStateChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)
            {
                foreach (var t in ((RadTileView)e.OriginalSource).ChildrenOfType<RadTileViewItem>())
                {
                    ((RadTileViewItem)t).minimizedheight = 150;
                }
                tileView1.UpdateItemsSizeAndPosition();
            }

    Don't forget to call UpdateItemsSizeAndPosition, else the changes will not be applied until you modify the layout (resize, tile state change etc.).

    Best regards,

    Levente
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 18 Aug 2010 Link to this post

    Hello Halász Levente,

    Thank you for your feedback. We'll highgly appreciate any additional comments on the blog post.

    Best wishes,
    Tina Stancheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 18 Aug 2010 Link to this post

    Hello Halász Levente,

    Thank you for your feedback. We'll highly appreciate any additional comments on the blog post.

    Thank you again.

    Best wishes,
    Tina Stancheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Halász Levente
    Halász Levente avatar
    21 posts
    Member since:
    Feb 2010

    Posted 19 Aug 2010 Link to this post

    Meanwhile I found the solution for the theming. It seems that if you apply the Windows7 (or any other theme) before you set your own style setting, then it'll be ok.
  6. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 24 Aug 2010 Link to this post

    Hello Halász Levente,

    I couldn't reproduce the theme issue you described. Can you please elaborate on it a bit more? What do you mean by "because it'll neutralize you're ItemContainerStyle settings."? And also how do you define "apply the Windows7 (or any other theme) before you set your own style setting"?

    We will highly appreciate your help on that. Thank you in advance.

    Sincerely yours,
    Tina Stancheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Halász Levente
    Halász Levente avatar
    21 posts
    Member since:
    Feb 2010

    Posted 25 Aug 2010 Link to this post

    Hello,

    What I meant is this
    <telerik:RadTreeListView x:Name="radTreeListView"
                                     ItemsSource="{Binding OfficeServices}"                        
                                    telerik:StyleManager.Theme="Windows7"
                                     Style="{StaticResource DraggableRadTreeListView}"  
                                     >

    This way it works as it should, my style is applied, if I change the order like this:
    <telerik:RadTreeListView x:Name="radTreeListView"
                                     ItemsSource="{Binding OfficeServices}" 
    Style="{StaticResource DraggableRadTreeListView}"                     
                                telerik:StyleManager.Theme="Windows7"
                                        
                                     >

    This way, all of my style settings will be overwritten by Windows7 style settings, so it will not get the desired functionality. Don't think you can do anything about it, it is the way it works. Sorry but did not realize this at my first attempt.

    Regards,

    Levente
  8. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 27 Aug 2010 Link to this post

    Hi Halász Levente,

    Thank you for the clarification.

    You are indeed right. However, I will try to clarify what is causing the behaviour you descibed.

    In Silverlight setting a theme to a RadControl is like setting a style to that control. Therefore when you set the Style property of a RadControl and you also define a Theme for it, both styles will be applied during the initialization of the control in the order they are set in its definition.
    So let's say that in the definition of the RadTileView you set Style and Theme in that particular order. What happens is - on initialization firstly the Style is applied to the RadTileView, then the Theme. Therefore, the style defined in the Theme overwrites the other style.

    Also, the ItemContainerStyle is always applied before the Theme. Therefore if you want to set both a theme to a RadControl and an ItemContainerStyle, you will need to set an application theme instead since the application themes allow defining an ItemContainerStyle to the RadControls.

    I hope this information helps.

    Sincerely yours,
    Tina Stancheva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. Josh King
    Josh King avatar
    15 posts
    Member since:
    Aug 2009

    Posted 15 Dec 2010 Link to this post

    I'm having trouble applying the Windows7 them to the RadTileView control.  Is there a trick to it?  Does it have to be an application setting?

    Thanks
  10. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 20 Dec 2010 Link to this post

    Hi Josh King,

    I tried to apply the theme in both xaml with telerik:StyleManager.Theme="Windows7" and in code-behind with StyleManager.SetTheme(this.myTileView, new Windows7Theme()); and everything is working fine for me, so could you tell me a little bit more about your problem( maybe give me a code snippet or a sample project )?

    Best wishes,
    Zarko
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  11. Josh King
    Josh King avatar
    15 posts
    Member since:
    Aug 2009

    Posted 20 Dec 2010 Link to this post

    I have it wrapped in a BusyIndicator and Border.  Would that make a difference?  Here's a code snippet:

    <telerik:RadBusyIndicator x:Name="busyIndicator" Grid.Row="4" Grid.Column="0" telerik:StyleManager.Theme="Windows7">
                <Border CornerRadius="6" telerik:StyleManager.Theme="Windows7">
                    <telerik:RadTileView x:Name="tileView" MaximizeMode="One" TileStateChangeTrigger="SingleClick" telerik:StyleManager.Theme="Windows7"
                                MinimizedColumnWidth="180" ItemsSource="{Binding}" TilesStateChanged="tileView_TilesStateChanged" TileStateChanged="tileView_TileStateChanged">
                        <telerik:RadTileView.ItemContainerStyle>
                            <Style TargetType="telerik:RadTileViewItem">
                                <Setter Property="MinimizedHeight" Value="125" />
                            </Style>
                        </telerik:RadTileView.ItemContainerStyle>
                        <telerik:RadTileView.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding AnalysisName, Mode=OneWay}" FontWeight="Bold" Foreground="{Binding HeaderColor}" />
                            </DataTemplate>
                        </telerik:RadTileView.ItemTemplate>
                        <telerik:RadTileView.ContentTemplate>
  12. Josh King
    Josh King avatar
    15 posts
    Member since:
    Aug 2009

    Posted 20 Dec 2010 Link to this post

    Nevermind....  I didn't have the Windows7 Theme dll referenced.  I forgot about that part.  
Back to Top
DevCraft banner