Databound items do not show until user scrolls

42 posts, 0 answers
  1. Tony
    Tony avatar
    12 posts
    Member since:
    Nov 2011

    Posted 01 Dec 2011 Link to this post

    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
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 02 Dec 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Tony
    Tony avatar
    12 posts
    Member since:
    Nov 2011

    Posted 02 Dec 2011 Link to this post

    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?
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 05 Dec 2011 Link to this post

    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 >>

  6. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 20 Dec 2011 Link to this post

    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>
  7. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 20 Dec 2011 Link to this post

    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>
  8. Tom
    Tom avatar
    2 posts
    Member since:
    Oct 2010

    Posted 20 Dec 2011 Link to this post

    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
  9. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 21 Dec 2011 Link to this post

    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 >>

  10. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 21 Dec 2011 Link to this post

    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.
  11. Tom
    Tom avatar
    2 posts
    Member since:
    Oct 2010

    Posted 21 Dec 2011 Link to this post

    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
  12. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 21 Dec 2011 Link to this post

    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.
  13. Tony
    Tony avatar
    12 posts
    Member since:
    Nov 2011

    Posted 21 Dec 2011 Link to this post

    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.
  14. Jog Rad
    Jog Rad avatar
    15 posts
    Member since:
    Nov 2011

    Posted 21 Dec 2011 Link to this post

    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..
  15. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 22 Dec 2011 Link to this post

    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 >>

  16. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 04 Jan 2012 Link to this post

    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.
  17. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 04 Jan 2012 Link to this post

    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 >>

  18. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 04 Jan 2012 Link to this post

    Hi Maya,

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

    Thanks,
    Norman.
  19. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 04 Jan 2012 Link to this post

    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 >>

  20. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 09 Jan 2012 Link to this post

    Hi Maya,

    Is there any update on this?

    Thanks,
    Norman.
  21. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 10 Jan 2012 Link to this post

    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 >>

  22. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 10 Jan 2012 Link to this post

    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.
  23. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 10 Jan 2012 Link to this post

    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 >>

  24. N Mackay
    N Mackay avatar
    228 posts
    Member since:
    Dec 2010

    Posted 10 Jan 2012 Link to this post

    Maya,

    I close the ticket.

    Thanks for your assistance in resolving this issue,

    Norman.
  25. Jog Rad
    Jog Rad avatar
    15 posts
    Member since:
    Nov 2011

    Posted 17 Jan 2012 Link to this post

    Are the binaries already available for download?
  26. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 17 Jan 2012 Link to this post

    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 >>

  27. Jog Rad
    Jog Rad avatar
    15 posts
    Member since:
    Nov 2011

    Posted 18 Jan 2012 Link to this post

    Hi,

    Where can I see the latest internal build (2012/01/09)?
    There is none in the download portal.
  28. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 18 Jan 2012 Link to this post

    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 >>

  29. Jog Rad
    Jog Rad avatar
    15 posts
    Member since:
    Nov 2011

    Posted 18 Jan 2012 Link to this post

    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
  30. Hristo
    Admin
    Hristo avatar
    408 posts

    Posted 18 Jan 2012 Link to this post

    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 >>

  31. Jog Rad
    Jog Rad avatar
    15 posts
    Member since:
    Nov 2011

    Posted 29 Jan 2012 Link to this post

    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
Back to Top
UI for WPF is Visual Studio 2017 Ready