Grid row height base TileView content.

2 posts, 0 answers
  1. Dominik
    Dominik avatar
    80 posts
    Member since:
    Dec 2012

    Posted 15 Jul 2018 Link to this post

    I have grid with 2 rows. I want to set first row Height base on how many lines are in RadTileView.

    All items should be visible on screen (without scrollbars).

    RadTileView items are moved automatically to next line if there is no place in current line.

    How can i achieve that?

    Sample code:

    <Grid>
           <Grid.RowDefinitions>
               <RowDefinition Height="*"/> <!--when RadTileView have more line height should change-->
               <RowDefinition Height="*"/>
           </Grid.RowDefinitions>
           <Grid.ColumnDefinitions>
               <ColumnDefinition Width="*"/>
           </Grid.ColumnDefinitions>
     
           <telerik:RadTileView x:Name="ll"
               HorizontalAlignment="Left"
               VerticalAlignment="Top"
               Grid.Column="0"
               Grid.Row="0"
               ItemsSource="{Binding current, Mode=OneWay}"/>
     
           ...

     

     

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2135 posts

    Posted 16 Jul 2018 Link to this post

    Hello Dominik,

    You can control the number of rows (lines) and columns in the RadTileView using its RowsCount and ColumnsCount properties. About changing the Height of the RowDefinition, you should be able to achieve your requirement by setting the Height to Auto. You can check this approach in the attached project.

    Regards,
    Martin Ivanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top