This is a migrated thread and some comments may be shown as answers.

HeaderTemplate with WrapVirtualizationStrategyDefinition

3 Answers 45 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aleksey
Top achievements
Rank 1
Aleksey asked on 20 Jun 2013, 09:56 PM
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>

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 25 Jun 2013, 06:46 AM
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.
0
Aleksey
Top achievements
Rank 1
answered on 21 Aug 2013, 09:46 AM
Sorry, it is not working.

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

0
Deyan
Telerik team
answered on 21 Aug 2013, 02:42 PM
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.
Tags
DataBoundListBox
Asked by
Aleksey
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Aleksey
Top achievements
Rank 1
Share this question
or