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

Show binded SelectedItem

1 Answer 101 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Sternico
Top achievements
Rank 1
Sternico asked on 16 Feb 2010, 10:05 AM
Hello,

I'm using the WPF Carousel in my application and bind the ItemsSource und SelectedItem properties. But when the carousel is loaded, the SelectedItem is not the one the carousel shows in front of it. I've looked at the SelectedItem property in the Loaded event and it was set correctly. I've tried many different ways to achive this:

foreach (CarouselItem item in carousel.Panel.Children)
{
   if (item.Item == carousel.SelectedItem)
   {
      item.BringIntoView();
   }
}

carousel.SetIsSelected(carousel.SelectedItem, true);
carousel.SetIsCurrent(carousel.SelectedItem, true);
this.carousel.BringDataItemIntoView(carousel.SelectedItem);

carousel.CurrentItem = carousel.SelectedItem;


But none of them worked. How can I achieve it?


1 Answer, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 17 Feb 2010, 04:16 PM
Hi Sternico,

Thank  you for reporting the binding issue with RadCarousel. We have already fixed it and the fix will be available in our next Internal Build.

For the time being you can try synchronizing the carousel and the combo by subscribing to the SelectionChanged event of the combo:

private void combo_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    if (this.combo.SelectedItem == null)
        return;
  
    this.RadCarousel1.SelectedItem = this.combo.SelectedItem;
    this.RadCarousel1.BringDataItemIntoView(this.RadCarousel1.SelectedItem);
}

I have updated your Telerik points.


Best wishes,
Milan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Carousel
Asked by
Sternico
Top achievements
Rank 1
Answers by
Milan
Telerik team
Share this question
or