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

BringDataItemIntoView doesn't work in some circumstances

1 Answer 86 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Oliver
Top achievements
Rank 1
Oliver asked on 14 Mar 2012, 09:05 PM
Hi,

I use Telerik V2010.3.1314.35

I have a TabControl with 2 TabItems, the first one contain a text and the second one contain  RadCarousel with 3 images. Of course, the default TabItme is the first one (the one who contain the text). When I star my application, I add my text to my first TabItem and I add my 3 images into my carousel. After adding my images to my carousel, I do the following:

carousel.BringDataItemIntoView(carousel.Items[0]);

After finishing reading my text, I click on my second tab to see the first image of my carousel and it's not there, I have to click on the carousel navigation button to see my images...

xaml:
                                    <telerik:RadCarousel Background="Transparent" ToolTip="{StaticResource ObtainCarouselFullscreen}" Name="SignCtxDocsCarousel" MouseRightButtonDown="SignCtxDocsCarousel_MouseRightButtonDown" VerticalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden" IsSynchronizedWithCurrentItem="True">
                                                <telerik:RadCarousel.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <telerik:RadCarouselPanel Path="{StaticResource horizontalPath}"/>
                                                    </ItemsPanelTemplate>
                                                </telerik:RadCarousel.ItemsPanel>
                                            </telerik:RadCarousel>

code:
-------

carousel.Items.Add(img);

if

 

(carousel.Items.Count > 0)

 

{

carousel.BringDataItemIntoView(carousel.Items[0]);


}


Thank's

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 15 Mar 2012, 08:58 AM
Hello,

 Please call the BringDataItemIntoView method when the Loaded event of the RadCarousel is raised.
Hopefully this will help.

All the best,
Didie
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Carousel
Asked by
Oliver
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or