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

SelectedItem Problem

1 Answer 89 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Manuel
Top achievements
Rank 1
Manuel asked on 17 Feb 2009, 04:25 PM
Hi, I've a problem with the SelectedItem property.
I set ItemsPerPage = 3

The databinding is OK, so I can scroll any element in the collection

But, when I try to do this:

this

 

.sampleCarousel.SelectedItem = this.sample.Items[index];

if the Item isn't in the view the Carousel doesn't update its view...

For example if the SelectedItem corresponds to item 3 in the collection and I do this

this.sampleCarousel.SelectedItem = this.sample.Items[1];

The carousel view doesn't update

Where is the problem?
Thanks in advance,
Manuel

 

1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 19 Feb 2009, 06:59 AM
Hi Manuel,

This is a know issue but it has a very easy workaround that will do the trick.

RadCarouselPanel panel = this.RadCarousel1.FindCarouselPanel();  
this.RadCarousel1.SelectedItem = this.sample.Items[index];  
Record record = this.RadCarousel1.FindRecord(this.sample.Items[index];);  
panel.BringDataItemIntoView(record); 

The BrindDataItemIntoView method will bring any Record to the center of the path. Still, it will not mark the Record as selected.
Hope this works

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.
Tags
Carousel
Asked by
Manuel
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or