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

No items until user action

3 Answers 39 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Roland
Top achievements
Rank 1
Roland asked on 07 Jul 2009, 03:49 AM
Hello,
I tried to recreating the 'First Look' sample with different objects. The code below is taken from the sample. I have only changed one line there.

public Example() 
        { 
            InitializeComponent(); 
            this.sampleRadCarousel.ItemsSource = DAL.GetCustomers(); 
            this.sampleRadCarousel.Loaded += new RoutedEventHandler(sampleRadCarousel_Loaded); 
        } 
 
        void sampleRadCarousel_Loaded(object sender, RoutedEventArgs e) 
        { 
            Path path = CreateLinePath(); 
            Telerik.Windows.Controls.RadCarouselPanel panel = this.sampleRadCarousel.FindCarouselPanel(); 
            panel.ItemsPerPage = 7; 
            panel.Path = path; 
        } 

The issue I am having is that the carousel does not display items until I move the mouse wheel or move the items in a different way.

The moduleCarousel.FindCarouselPanel().BringDataItemIntoView(customer); does not help. Is there a way to refresh or something ?

3 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 07 Jul 2009, 07:18 AM
Hi Roland,

By default, the RadCarouselPanel tries to fill the path only if there are enough items.
You should be able to use the BrindDataItemIntoView method without any problems, you just have to provide a Record as a parameter. You can do something like that:

Record record = this.sampleRadCarousel.FindRecord(customer);  
 
this.sampleRadCarousel.FindCarouselPanel().BringDataItemIntoView(record); 

You could also use the scrolling API :

this.sampleRadCarousel.FindCarouselPanel().MoveBy(7);  
this.sampleRadCarousel.FindCarouselPanel().PageDown();  
this.sampleRadCarousel.FindCarouselPanel().LineDown(); 

The MoveBy method scrolls the carousel by a specified amount, PageDown scrolls by one page, and LineDown scrolls by a single item.

Hope this helps.

Kind regards,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Roland
Top achievements
Rank 1
answered on 07 Jul 2009, 02:04 PM
Thanks for fast answer.

However, If I dont press the button or scroll mouse wheel, none of the methods are working.

.BringDataItemIntoView(record); and Record are obsolete and should not be used.

The only thing that works is Rebind() and the items are shown.



0
Accepted
Milan
Telerik team
answered on 08 Jul 2009, 01:56 PM
Hi Roland,

I have just introduced new method on RadCarousel called BringDataItemIntoView that will bring into view any data item (not record). It will be available in our Latest Internal Build this Friday.

Thanks for your feedback - your Telerik points have been updated.

Greetings,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Carousel
Asked by
Roland
Top achievements
Rank 1
Answers by
Milan
Telerik team
Roland
Top achievements
Rank 1
Share this question
or