HeaderTemplate with WrapVirtualizationStrategyDefinition

4 posts, 0 answers
  1. Aleksey
    Aleksey avatar
    3 posts
    Member since:
    Apr 2013

    Posted 20 Jun 2013 Link to this post

    Hello!

    I'm using RadDataBoundListBox inside RadWindow control. I have a list of tiles I want to place side by side using WrapVirtualizationStrategyDefinition. They all worked great until I had to set a header for RadDataBoundListBox and failed. It just is not showing the header. Header works well with StackVirtualizationStrategyDefinition, but this is not what I need.

    Please help! Thank you.

    <telerikPrimitives:RadDataBoundListBox
                        Margin="10,0"
                        ItemsSource="{Binding Categories}"
                        telerikCore:InteractionEffectManager.IsInteractionEnabled="True">
                         
                        <telerikPrimitives:RadDataBoundListBox.VirtualizationStrategyDefinition>
                            <telerikPrimitives:WrapVirtualizationStrategyDefinition Orientation="Horizontal"/>
                        </telerikPrimitives:RadDataBoundListBox.VirtualizationStrategyDefinition>
     
                        <telerikPrimitives:RadDataBoundListBox.ListHeaderTemplate>
                            <DataTemplate>
                                <Grid Height="150"/>
                            </DataTemplate>
                        </telerikPrimitives:RadDataBoundListBox.ListHeaderTemplate>
                         
                        <telerikPrimitives:RadDataBoundListBox.ItemAddedAnimation>
                            <telerikCore:RadFadeAnimation StartOpacity="0" EndOpacity="100"/>
                        </telerikPrimitives:RadDataBoundListBox.ItemAddedAnimation>
                         
                        <telerikPrimitives:RadDataBoundListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="10,10" Height="170" Width="210" Background="{Binding CategoryBackground}">
                                    <TextBlock Foreground="White" FontSize="60" VerticalAlignment="Center" TextAlignment="Center" Text="{Binding EventsCount}" Margin="0,-10,0,0"/>
                                    <TextBlock Foreground="White" VerticalAlignment="Bottom" TextAlignment="Left" Text="{Binding Name}" Margin="10" FontSize="26"/>
                                </Grid>
                            </DataTemplate>
                        </telerikPrimitives:RadDataBoundListBox.ItemTemplate>
                    </telerikPrimitives:RadDataBoundListBox>

  2. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 25 Jun 2013 Link to this post

    Hi Aleksey,

    From what I see in your XAML code you have explicitly set Height on the Grid element in the header template. This will make the header appear when in stack mode but will not make it visible when in horizontal wrap mode since in this mode the Width is also important.

    Please try setting Width as well and see if it resolves the case for you.

    Regards,
    Deyan
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Aleksey
    Aleksey avatar
    1 posts
    Member since:
    Mar 2013

    Posted 21 Aug 2013 Link to this post

    Sorry, it is not working.

    <telerikPrimitives:RadDataBoundListBox.ListFooterTemplate>
        <DataTemplate>
            <Grid Height="100"
                  Width="100"
                  Background="Red"/>
        </DataTemplate>
    </telerikPrimitives:RadDataBoundListBox.ListFooterTemplate>

  5. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 21 Aug 2013 Link to this post

    Hello Aleksey,

    From the XAML code you have pasted I see that you are setting the ListFooterTemplate. You have to use the ListHeaderTemplate to define a header.

    Regards,
    Deyan
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top
DevCraft banner