Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Carousel > Databound items do not show until user scrolls

Not answered Databound items do not show until user scrolls

Feed from this thread
  • Tony avatar

    Posted on Dec 1, 2011 (permalink)

    I have a fairly simple scenario, where a RadCarousel's ItemsSource is databound to an ObservableCollection of items in the ViewModel. The RadCarousel specifies a simple item template that shows a button image with text below it. The RadCarousel is using all default options and styles other than that ItemTemplate.

    The problem I witness is that when the view loads, the RadCarousel appears to be empty, although I have a single item in my ObservableCollection. If I scroll the RadCarousel or use the navigation buttons, the single item pops into view and does appear normally.

    Has anyone else ever seen this behavior?

    For record, I'm using WPF 4 with the Q3 2011 release (2011.3.1116.40)

    EDIT: I've also tried this with multiple items in the collection. The same behavior is exhibited.

    Thanks in advance...
    -Tony

    Reply

  • Maya Maya admin's avatar

    Posted on Dec 2, 2011 (permalink)

    Hello Tony,

    Actually, that would be the expected behavior. If you want to have an item displayed immediately on loading, you can try one of the following approaches:

    void MyRadCarousel_Loaded(object sender, RoutedEventArgs e)
    {
        //Option 1
        this.MyRadCarousel.BringDataItemIntoView(this.carouselMilan.Items[0]);
        //Option 2
        this.MyRadCarousel.FindCarouselPanel().MoveBy(3);
        //Option 3
        this.MyRadCarousel.FindCarouselPanel().PageDown();
        //Option 4
        this.MyRadCarousel.FindCarouselPanel().LineDown();             
    }

    All the best,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Tony avatar

    Posted on Dec 2, 2011 (permalink)

    Thanks for the quick reply. I'm afraid none of the options you've posted work for us, though. I've tried each option, verified the Loaded event was firing, verified there were items in the Carousel, but none of them are visible until the user either scrolls or uses the navigation controls. The behavior is exactly the same as before. Why would this be?

    Reply

  • Maya Maya admin's avatar

    Posted on Dec 5, 2011 (permalink)

    Hello Tony,

    I am attaching a sample project illustrating my attempt to get the same behavior as the one you described. Unfortunately, I was not able to. Could you take a look at the application and verify whether you can reduce the issue on it ? Am I missing something ? 

    Greetings,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Attached files

    Reply

  • Norman avatar

    Posted on Dec 20, 2011 (permalink)

    Hi,

    I've upgraded our project to the latest version of WPF Rad Controls VS2010 SP1 (.NET4 XP SP3) and I get the exact same behaviour.

    I was just testing the app to see if it was compatible with the latest controls.

    It worked fine until I upgraded.

    I tried your suggested solutions but they don't have any effect, you have to use the mouse scroll wheel to bring items into view.

    Regards,
    Norman.

                    <DataTemplate x:Key="CarouselItemTemplate">
                    <Grid x:Name="grid" Height="550" HorizontalAlignment="Left" Width="600">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <TextBlock Grid.Row="0" Text="{Binding Path=VesselName}" HorizontalAlignment="Center" Margin="5" FontSize="14" />
                            <Image Grid.Row="1" Source="{Binding Path=Filename}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5" ></Image>
      
                        </Grid>
                    </Grid>
                </DataTemplate>
      
                    <telerik:RadCarousel Grid.Row="0" Name="_radcarousel_vessel" 
                                 ItemTemplate="{StaticResource CarouselItemTemplate}" 
                                 HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" VerticalAlignment="Top">
                <telerik:RadCarousel.ReflectionSettings>
                    <telerik:ReflectionSettings Visibility="Visible"/>
                </telerik:RadCarousel.ReflectionSettings>
      
                <telerik:RadCarousel.ItemsPanel>
                    <ItemsPanelTemplate>
                        <telerik:RadCarouselPanel AutoLoadItems="False" />
                    </ItemsPanelTemplate>
                </telerik:RadCarousel.ItemsPanel>
            </telerik:RadCarousel>

    Reply

  • Norman avatar

    Posted on Dec 20, 2011 (permalink)

    Maya,

    I edited your example and your sample app doesn't work now either, the call below has no effect.

    Regards,
    Norman.

    this.myRadCarousel.FindCarouselPanel().MoveBy(3)

    XAML
    <Window x:Class="RadCarousel.MainWindow"
            Title="MainWindow" Height="350" Width="525">
        <Grid>
            <telerik:RadCarousel x:Name="myRadCarousel" HorizontalScrollBarVisibility="Hidden" >
                <telerik:RadCarousel.ReflectionSettings>
                    <telerik:ReflectionSettings Visibility="Visible"/>
                </telerik:RadCarousel.ReflectionSettings>
      
                <telerik:RadCarousel.ItemsPanel>
                    <ItemsPanelTemplate>
                        <telerik:RadCarouselPanel AutoLoadItems="False" />
                    </ItemsPanelTemplate>
                </telerik:RadCarousel.ItemsPanel>
            </telerik:RadCarousel>
        </Grid>
    </Window>

    Reply

  • Tom avatar

    Posted on Dec 20, 2011 (permalink)

    Hi,

    We upgraded from Q2 2010 SP2 release to Q3 2011 release and get the same behaviour as the others have reported.
    I have also played around with the project in RadCarousel.zip, and whatever I do, it's allways item 3 that is selected. Doesn't seem like BringDataItemIntoView is working at all when called triggerd by the Loaded event.

    Regards,
    Tom

    Reply

  • Maya Maya admin's avatar

    Posted on Dec 21, 2011 (permalink)

    Hello all,

    I checked the sample I previously attached and it is totally my mistake - you need to handle Loaded event of the containing RadCarouselPanel, not directly RadCarousel. So, it should be:

    private void myRadCarousel_Loaded(object sender, RoutedEventArgs e)
            {
                this.myRadCarousel.FindCarouselPanel().Loaded += new RoutedEventHandler(MainWindow_Loaded);
            }
     
            void MainWindow_Loaded(object sender, RoutedEventArgs e)
            {
                (sender as RadCarouselPanel).MoveBy(1);
            }

    The same is applicable for calling BringDataItemIntoView(dataItem).
    Please accept my apology for the misunderstanding.
     

    All the best,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Norman avatar

    Posted on Dec 21, 2011 (permalink)

    Maya,

    We can't accept this as a solution, it's just a workaround to a bug in the control.

    A callback the Loaded event is not a good solution (this only works if the window just using the carousel which won't be the case most of the time) and coding this in VB.NET is clunky as you have to use AddHandler, we don't to add callbacks unnecessarily to work around control limitations.

    I stress again this version of the control introduced the behaviour we're experiencing and it's clearly a bug as it worked before.

    I have to raise a support ticket as this is a breaking change.

    Regards,
    Norman.

    Reply

  • Tom avatar

    Posted on Dec 21, 2011 (permalink)

    Hi Maya,

    Your suggestion is fine as a workarond for my case. But I agree with Norman that this is a bug in the control's behaviour, since it worked in previous versions.


    Regards,
    Tom

    Reply

  • Norman avatar

    Posted on Dec 21, 2011 (permalink)

    Hi Maya,

    I had to raise a ticket (494986) for this issue as this is not an acceptable workaround.

    It's worth noting that this issue exists in Q3 2011_3_1116 and Q3 2011_3_1220.

    Regards,

    Norman.

    Reply

  • Tony avatar

    Posted on Dec 21, 2011 (permalink)

    I agree. This is an obvious bug in the control and not expected behavior as we're being told. Many companies have policies against adding to their codebase to workaround defects in third party controls. Until this is corrected in the RadCarousel, we'll be exploring other options for controls on that particular screen of our application.

    Norman, thanks for opening a ticket. Hopefully this gets resolved soon.

    Reply

  • Jog Rad avatar

    Posted on Dec 21, 2011 (permalink)

    Hi,

    I have the same issues with this one. My scenario is..

    1. I have a window that has a view.
    2. In this view, there I display my carousel Items
    3. I'm using an mvvm pattern for the Loaded event

    XAML CODE:
    <telerik:RadCarousel x:Name="thumbnailCarousel"  ItemsSource="{Binding Path=FilePageList}" >
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Loaded">
                        <mynamespace:LoadCommandBinding Command="{Binding LoadCarouselCommand}"
                            CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=InvokeParameter}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
    ...
    </telerik:RadCarousel> 

    ViewModel CODE:
    private RelayCommand loadCarouselCommand;
    public ICommand LoadCarouselCommand
            {
                get
                {
                    if (loadCarouselCommand == null)
                    {
                        Action<object> loadAction = new Action<object>(OnCarouselLoaded);
                        loadCarouselCommand = new RelayCommand(loadAction);
                    }
                    return loadCarouselCommand;
                }
            }

    private void OnCarouselLoaded(object param)
            {
                if (param is RoutedEventArgs)
                {
                    RoutedEventArgs re = param as RoutedEventArgs;


                    RadCarousel fileCarousel = re.OriginalSource as RadCarousel;
                    if (fileCarousel == null)
                        return;


                    fileCarousel.FindCarouselPanel().Loaded += new RoutedEventHandler(FileCarouselPanel_Loaded);
                }
            }

    private void FileCarouselPanel_Loaded(object sender, RoutedEventArgs e)
            {
                (sender as RadCarouselPanel).MoveBy(3);
            }

    4. I used a dispatcher to get the items to bind to the item source

    The problem now is that it displayed the carousel items for a few milliseconds then disappears from view afterwards..

    Reply

  • Maya Maya admin's avatar

    Posted on Dec 22, 2011 (permalink)

    Hi all,

    Indeed, this behavior used to be the one illustrated in the beginning of the thread. However, since we introduced Continuous-functionality of RadCarousel in Q3 2011 release, it has slightly changed (that is why not it is needed to handle Loaded event of RadCarouselPanel).
    Nevertheless, we will investigate the case and try to provide a valuable solution so that your requirements are met as well. 
    Thank you for your understanding.
     

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Norman avatar

    Posted on Jan 4, 2012 (permalink)

    Hi Maya,

    Are we any further forward to finding a solution for this ?

    Our application no longer works as expected and a new release can't be shipped while this issue exists as the workaround is not acceptable.

    Thanks,
    Norman.

    Reply

  • Maya Maya admin's avatar

    Posted on Jan 4, 2012 (permalink)

    Hello,

    The fix will be available most probably in our next internal build. 
     

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Norman avatar

    Posted on Jan 4, 2012 (permalink)

    Hi Maya,

    Can you add this to the PITS system so we can track which release the fix will be in.

    Thanks,
    Norman.

    Reply

  • Maya Maya admin's avatar

    Posted on Jan 4, 2012 (permalink)

    Hello,

    The issue has been added into our Public Issue Tracking System and you can follow its progress here.
     

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Norman avatar

    Posted on Jan 9, 2012 (permalink)

    Hi Maya,

    Is there any update on this?

    Thanks,
    Norman.

    Reply

  • Maya Maya admin's avatar

    Posted on Jan 10, 2012 (permalink)

    Hi Norman,

    The issue has been resolved in our latest internal build. I am sending you a sample project with those binaries so that you can test the functionality right away.
    Please let us know in case you have any other problems with it.

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Attached files

    Reply

  • Norman avatar

    Posted on Jan 10, 2012 (permalink)

    Hi Maya,

    Thanks for your response.

    I can confirm the carousel behaves as previously now. Also using Autoload and IsContinuous seems to work as expected.

    Will this fix be in the next official release? just so I can close the ticket.

    Thanks for your assistance,
    Norman.

    Reply

  • Maya Maya admin's avatar

    Posted on Jan 10, 2012 (permalink)

    Hello Norman,

    Generally, all the fixes we introduce in our internal builds are included in our major releases as well.

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Norman avatar

    Posted on Jan 10, 2012 (permalink)

    Maya,

    I close the ticket.

    Thanks for your assistance in resolving this issue,

    Norman.

    Reply

  • Jog Rad avatar

    Posted on Jan 17, 2012 (permalink)

    Are the binaries already available for download?

    Reply

  • Maya Maya admin's avatar

    Posted on Jan 17, 2012 (permalink)

    Hi Jog,

    The binaries are already available and can be found in our Latest Internal Build.

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Jog Rad avatar

    Posted on Jan 18, 2012 (permalink)

    Hi,

    Where can I see the latest internal build (2012/01/09)?
    There is none in the download portal.

    Reply

  • Maya Maya admin's avatar

    Posted on Jan 18, 2012 (permalink)

    Hello Jog,

    Generally, Latest Internal Builds are available either if you have a valid trial or a purchase. As it turns out, your trial has expired, no purchases are present under your account and unfortunately, you do not have access to the latest builds. 

    Kind regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Jog Rad avatar

    Posted on Jan 18, 2012 (permalink)

    Hi Maya,

    Yeah, my account is just a trial version but our server admin has the purchased one (licensed). We downloaded the latest there is in the download portal which is dated 2011/12/20. No 2012/01/09 (latest internal build) version is available. Please advise.

    Best regards,
    Jog

    Reply

  • Hristo Hristo admin's avatar

    Posted on Jan 18, 2012 (permalink)

    Hi Jog,

    I have checked your company account and it turns out that there are not any associated licenses with it either. Please contact your license holder and ask him to add you as a licensed developer. In this way you will get access to our latest internal builds.


    All the best,
    Hristo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Jog Rad avatar

    Posted on Jan 29, 2012 (permalink)

    Hi,

    When is the major build that this fix is included? The company that I am working currently have the 2011_3_1220.

    Best Regards,
    Jog

    Reply

  • Maya Maya admin's avatar

    Posted on Jan 30, 2012 (permalink)

    Hi Jog,

    The fix will be available in our next official release Q1 2012 that is to be release in the middle of February.  

    All the best,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

  • Jog Rad avatar

    Posted on Jan 30, 2012 (permalink)

    Hi Maya,

    Thanks

    Best Regards,
    Jog

    Reply

  • Nolan Barnes avatar

    Posted on Mar 29, 2012 (permalink)

    Hi Maya,

    thanks for the advice to look into his thread.
    The problem still exists. I am currently working with Q1 2012 and I have still the same problem.
    The workaround is not an option, when the radcarousel is part of a lookless customcontrol. 
    I thought of another workaround:
    The radcarousel must know its itemsperpage dynamically binded to an  itemsource count. Unfortunately I ran into another problem with this idea: it will also change the style and measures of the carouselpanels.
    To be honest, I am not a great fan of workaraounds!
    So what is the real solution??

    Reply

  • Maya Maya admin's avatar

    Posted on Mar 29, 2012 (permalink)

    Hello Nolan,

    I tested the project attached in this thread with our current official release (Q1 2012 SP1) and everything works as expected.  You can try it on and check that the required item is scrolled into view once Loaded event of RadCarousel is fired. Furthermore, if you remove the whole handler, all items will be displayed as well (this, however, depends on the number of items per page and the number of the items in the source).
    Could you clarify what is the behavior that you get ? 


    Greetings,
    Maya
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Carousel > Databound items do not show until user scrolls
Related resources for "Databound items do not show until user scrolls"

WPF Carousel Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]