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

ItemAddedAnimation for each Item

3 Answers 71 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.
Tariq
Top achievements
Rank 2
Tariq asked on 20 Jan 2012, 02:31 AM
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);
            }

3 Answers, 1 is accepted

Sort by
0
Tariq
Top achievements
Rank 2
answered on 20 Jan 2012, 04:43 AM
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
0
Tariq
Top achievements
Rank 2
answered on 22 Jan 2012, 06:32 PM
Can someone please answer this? let me know, if its not possible
0
Deyan
Telerik team
answered on 23 Jan 2012, 10:45 AM
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 >>

Tags
DataBoundListBox
Asked by
Tariq
Top achievements
Rank 2
Answers by
Tariq
Top achievements
Rank 2
Deyan
Telerik team
Share this question
or