MinHeight, Horizontal layout, Height of RDBLB

6 posts, 0 answers
  1. Alex
    Alex avatar
    25 posts
    Member since:
    Mar 2011

    Posted 13 Aug 2013 Link to this post

    Hey!
    I found out when using RDBLB in horizontal mode, it's MinHeight is set to 100 somewhere, so you can't easily have smaller  than 100 units.

    <telerikPrimitives:RadDataBoundListBox ItemsSource="{Binding }" 
                                          EmptyContentDisplayMode="DataSourceEmpty"
                                          EmptyContentTemplate="{StaticResource DefaultEmptyContentTemplate}"
                                          ItemLoadingTemplate="{StaticResource EmptyDataTemplate}"
                                          ItemTemplate="{StaticResource ItemTemplate}"
                                          Margin="0" Background="White">
              <telerikPrimitives:RadDataBoundListBox.VirtualizationStrategyDefinition>
                  <telerikPrimitives:StackVirtualizationStrategyDefinition Orientation="Horizontal"/>
              </telerikPrimitives:RadDataBoundListBox.VirtualizationStrategyDefinition>
              <telerikPrimitives:RadDataBoundListBox.ItemAddedAnimation>
                  <telerik:RadFadeAnimation StartOpacity="0" EndOpacity="1" Duration="0:0:1"/>
              </telerikPrimitives:RadDataBoundListBox.ItemAddedAnimation>
          </telerikPrimitives:RadDataBoundListBox>
     
    What I see in runtime is that my items are 80 units high, and the control is 100 units high.
    XamlSpy shows following: MinHeight is set to 100 units. (see attached image).

    Setting MinHeight to lower value makes control high of this value, even if items are taller.

    Please advice

  2. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 15 Aug 2013 Link to this post

    Hi Alex,

    Thanks for writing and for reporting this.

    Indeed, RadDataBoundListBox has its MinHeight and MinWidth properties initialized by its default Style. We will revisit this but we need some further details on your scenario so that we can make sure we handle the case correctly:

    1. Do you want to have your DataBoundListBox autosized based on the items' size even if their size is smaller than 100?

    2. Is clearing the style acquired values of the MinWidth and MinHeight properties resolving this limitations?

    3. Can you please send us a sample project that reproduces your scenario so that we debug the case and see how we need to update the behavior of the control to better handle the scenario?

    Regards,
    Deyan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Alex
    Alex avatar
    25 posts
    Member since:
    Mar 2011

    Posted 19 Aug 2013 Link to this post

    1. Yes. I want it to take height which fits all items
    2. Making MinHeight=0 makes control be of height=0. Very strange to me.
    3. Item template is following

       <Button c:TiltEffect.IsTiltEnabled="True" Command="{Binding ShowItemCommand, Source={StaticResource V}}" CommandParameter="{Binding}" Margin="0"
                               d:DataContext="{d:DesignInstance services:Item1}" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Button.Template>
                    <ControlTemplate>
                        <Border Background="White" HorizontalAlignment="Left" VerticalAlignment="Top">
                            <Image Source="{Binding LogoUrl}" VerticalAlignment="Top" HorizontalAlignment="Center" Stretch="None" Margin="0"/>
                        </Border>
                    </ControlTemplate>
                </Button.Template>
            </Button>
  5. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 22 Aug 2013 Link to this post

    Hello Alex,

    Can you please try clearing the local value of the MinHeight property:

    this.radListBox.ClearValue(RadDataBoundListBox.MinHeightProperty);

    Does this work for you?

    Regards,
    Deyan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Alex
    Alex avatar
    25 posts
    Member since:
    Mar 2011

    Posted 26 Aug 2013 Link to this post

    Well, the xaml is inside default control style (themes/generic.xaml) and it's not that easy to clear the height.
    For now I decided to go with fixed width.

    Next time I see the issue I'll try your workaround.

    Thank you
  7. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 26 Aug 2013 Link to this post

    Hi Alex,

    You can just extract the style in Blend or Visual Studio and remove these settings.

    We will make sure to review this portion of the style anyway.

    We will consider this thread closed for now. Feel free to get back to us anytime you need further assistance.

    Regards,
    Deyan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
DevCraft banner