ItemAddedAnimation for each Item

4 posts, 0 answers
  1. Tareq
    Tareq avatar
    36 posts
    Member since:
    Jun 2011

    Posted 19 Jan 2012 Link to this post

    Hi, I'm trying to use this feature, so when the control loads, it shows each item with a simple animation. the problem is that i get the animation for the whole control, I'm sure am missing something but i dont get it. here is my code

    <telerik:RadDataBoundListBox x:Name="lstResults">
                    <telerik:RadDataBoundListBox.ItemAddedAnimation>
                        <telerikcore:RadMoveAnimation StartPoint="500, 0" EndPoint="0, 0" Duration="0:0:1">
                            <telerikcore:RadMoveAnimation.Easing>
                                <CubicEase EasingMode="EaseOut"/>
                            </telerikcore:RadMoveAnimation.Easing>
                        </telerikcore:RadMoveAnimation>
                    </telerik:RadDataBoundListBox.ItemAddedAnimation>
                    <telerik:RadDataBoundListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Margin="10,5">
                                <TextBlock Text="{Binding Name}" FontSize="30" />
                            </StackPanel>
                        </DataTemplate>
                    </telerik:RadDataBoundListBox.ItemTemplate>
                </telerik:RadDataBoundListBox>

    and here I populate the list:
    ObservableCollection<string> Items = new ObservableCollection<string>();
     
    lstResults.ItemsSource = Items;
                for (int i = 0; i < 7; i++)
                {
                    Items.Add("item "+i);
                }
  2. Tareq
    Tareq avatar
    36 posts
    Member since:
    Jun 2011

    Posted 19 Jan 2012 Link to this post

    If I change the order of the C# code to this, it works:
    ObservableCollection<string> Items = new ObservableCollection<string>();
      
                for (int i = 0; i < 7; i++)
                {
                    Items.Add("item "+i);
                }
    lstResults.ItemsSource = Items;

    But I want to populate Items to the ObservableCollection after assigning the ItemsSource of the list.  Help please
  3. DevCraft banner
  4. Tareq
    Tareq avatar
    36 posts
    Member since:
    Jun 2011

    Posted 22 Jan 2012 Link to this post

    Can someone please answer this? let me know, if its not possible
  5. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 23 Jan 2012 Link to this post

    Hi Tareq,

    RadDataBoundListBox exposes the ItemAddedAnimationInterval property which is used to define a time interval which will be added between each separate item animation. Using this interval you can achieve the delayed animation effect for the separate items. However, this property works only when you set the items source after having popuplated your source collection. In the scenario when populating the collection after setting it as a source this property will not work (since the control is in a mode when animations are played exactly when an item is added to the source collection, without any delays).

    We can think of a way to update the behavior of the control here to support your scenario as well. For the time being, however, I suggest you use the workaround of populating the collection before setting it as a source if possible.

    I hope this helps.

    Regards,
    Deyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top