No items until user action

4 posts, 1 answers
  1. Roland
    Roland avatar
    156 posts
    Member since:
    Feb 2009

    Posted 06 Jul 2009 Link to this post

    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 ?
  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 07 Jul 2009 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Roland
    Roland avatar
    156 posts
    Member since:
    Feb 2009

    Posted 07 Jul 2009 Link to this post

    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.



  5. Answer
    Milan
    Admin
    Milan avatar
    1989 posts

    Posted 08 Jul 2009 Link to this post

    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.
Back to Top