Tile can not be made smaller 167 px

5 posts, 1 answers
  1. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 19 Oct 2012 Link to this post

    Hi

    I have following tileview:

    <telerik:RadTileView x:Name="PhotoTiles"
                                                   ItemsSource="{Binding PagedSource, ElementName=myDataPager}"
                                                   TilesStateChanged="RadTileViewTilesStateChanged"
                                                   Grid.Column="0" Grid.Row="1"
                                                   PreservePositionWhenMaximized ="True"
                                                   telerik:TileViewPanel.IsVirtualized ="True"
                                                   IsAutoScrollingEnabled="True"
                                                   TileStateChangeTrigger ="SingleClick"
                                                   MinimizedColumnWidth ="167"
                                                   MinimizedRowHeight ="120"                                              
                                                   ColumnWidth = "167"     
                                                   RowHeight ="120"
                                                   MaximizeMode = "ZeroOrOne"
                                                   MinimizedItemsPosition="Bottom"
                                                   SelectionMode="Single"
                                                   IsSelectionEnabled="True"                                              
                                                    
                                                   >
                      <telerik:RadTileView.ItemTemplate>
                        <DataTemplate telerik:ContainerBinding.ContainerBindings="{StaticResource bindings}">
                          <TextBlock Text="{Binding Name}" />
                        </DataTemplate>
                      </telerik:RadTileView.ItemTemplate>
                      <telerik:RadTileView.ContentTemplate>
                        <DataTemplate>
                          <telerik:RadFluidContentControl ContentChangeMode="Automatic" TransitionDuration="0:0:.5" State="{Binding State, Converter={StaticResource tileConverter}}" >                         
                            <telerik:RadFluidContentControl.Content>
                              <ContentPresenter Content="{Binding Converter={StaticResource myConverter}}" />                         
                            </telerik:RadFluidContentControl.Content>                         
                            <telerik:RadFluidContentControl.LargeContent>
                              <Image x:Name="LargeImage" Tag="{Binding Tag}" Source ="{Binding Image}" Stretch="Uniform" Loaded="ImageLoaded"/>
                            </telerik:RadFluidContentControl.LargeContent>
                          </telerik:RadFluidContentControl>
                        </DataTemplate>
                      </telerik:RadTileView.ContentTemplate>
                    </telerik:RadTileView>

    The tileview contains pictures.

    Everything works ok just as long as i make the tilewidth larger or equal to 167

    If i make the tilewidth < 167, the tiles don't show any pictures anymore. I can make em as big as i want, but not smaller then 167. This is an enoying problem and i don't see how it could be related to my code, since i can even make the images themselves smaller then 167, but i can not make the tiles any smaller.

    Is there a build in limit width?

    Best Regards,

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

    Posted 23 Oct 2012 Link to this post

    Hi Peter,

    We could not reproduce the issue that you described. Can you please elaborate on what are the ContainerBindings bound to? It will be best if you can send us your project so we can understand your scenario better.

    Also you can take a look at the attached project to see if the issue can be reproduced in it.

    Regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 25 Oct 2012 Link to this post

    Hi Pavel,

    It seems i just needed to add the SmallContent template to the RadFluidContentControl to fix the problem.

    It is strange that you don't need it with a size bigger then 167, but maybe this was code into the RadFluidContentControl?

    Best Regards,

    Peter
  5. Answer
    Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 29 Oct 2012 Link to this post

    Hi Peter,

    We have noticed that you have set the RadFluidContentControl ContentChangeMode property to Automatic.  By doing so, you're saying that the control will change its state based on its threshold properties. And as the switch between the normal and small content is controlled by the NormalToSmallThreshold property and its default value is 150x150 pixels, as soon as the control gets smaller that this threshold it will display its SmallContent. And if there is no SmallContent defined  the control will not be able to show any content.

    However, as you're using the control inside a RadTileView and you need to synchronize the TileState with the State of the RadFluidContentControl, it will be best if the ContentChangeMode property of the FluentContentControl is set to Manual and you change it's state when the TileStateChanged event is invoked. This approach is demonstrated in this article. If you use data-binding scenario it will be even better if you bind the State of the RadFluidContentControl to the TileState of the RadTileViewItem as demonstrated in this article.

    Regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 30 Oct 2012 Link to this post

    Hi Pavel,

    I will keep it in mind next time i need to use this component. I feel that the fact that it does not show anything with SmallContent missing is reason to raise somekind of error to the developer. But i don't know enough of the code to really judge on that.

    Now that i know, i can watch out for this problem.

    Thanks for the explanation.

    Best Regards,

    Peter
Back to Top
DevCraft banner