locked
FlipView bug when remove last item RRS feed

  • Question

  • Hello!

    Here are project - http://sdrv.ms/15FeMNb

    Steps to reproduce:

    1. move to last flipview item.

    2. Select some radio button on last flipview item and press Delete button.

    .

    3. Move to next item:

    4.Got exception - Unhandled exception "Value does not fall within the expected range."

    Notes:

    - if I drop Virtualizing stack panel from template, all works fine. But I can't drop it, because I need this virtualization.

    - cannot reproduce this bug on 8.1.

    Any suggestions?

    Monday, September 30, 2013 10:17 AM

Answers

  • Oleg - try out this code:
     private async void Button_Click(object sender, RoutedEventArgs e)
            {
                test.ItemsSource = null;
                this.model.Items.RemoveAt(this.model.Items.Count - 1);
                await Dispatcher.RunAsync(
                    Windows.UI.Core.CoreDispatcherPriority.Normal,
                    () =>
                        {
                            test.ItemsSource = this.model.Items;
                        });
            }


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Oleg Kurzov Thursday, October 10, 2013 3:03 PM
    Thursday, October 10, 2013 2:24 PM
    Moderator

All replies

  • I don't have a Windows 8 system handy to test on, and as you say this appears to be fixed in 8.1

    From your screenshots it looks like the FlipView's selection goes to 0 after the last item is deleted rather than going to the (new) last item and not having a "next" button. Is that correct? Or were there extra steps not displayed?

    --Rob

    Monday, September 30, 2013 7:49 PM
    Moderator
  • Hi Oleg,

    I will check this out early tomorrow (my end of the day) and let you know what I find out.

    Jeff


    Jeff Sanders (MSFT)

    @jsandersrocks - Windows Store Developer Solutions @WSDevSol
    Getting Started With Windows Azure Mobile Services development? Click here
    Getting Started With Windows Phone or Store app development? Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)

    Monday, September 30, 2013 8:04 PM
    Moderator
  • Is that correct? 


    Yes, after removing item, flipview go to the first item, not to the new last item. Also, in 8.1 it's go to new last item. But in 8.1 I tried to set in flipview selected item to first flipview item (using twoway bindings) and its work fine when item changed and I tap next flipview item.

    It's only reproduce when I use RadioButton/CheckBox in DataTemplate and select it before remove flipview item.


    Tuesday, October 1, 2013 7:09 AM
  • Hello again! /*up topic*/

    Tuesday, October 1, 2013 8:30 PM
  • Hi Oleg,

    I won't be able to get to this until later this week.  If you need immediate assistance you can certainly create a support case!  http://support.microsoft.com/oas


    Jeff Sanders (MSFT)

    @jsandersrocks - Windows Store Developer Solutions @WSDevSol
    Getting Started With Windows Azure Mobile Services development? Click here
    Getting Started With Windows Phone or Store app development? Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)

    Wednesday, October 2, 2013 12:50 PM
    Moderator
  • Hi Jeff.
    No, it's not urgent. I'll wait for your response. Thanks.
    Wednesday, October 2, 2013 1:22 PM
  • Up. Anyone check my sample?
    Monday, October 7, 2013 7:04 AM
  • Up. /o/
    Monday, October 7, 2013 1:37 PM
  • Please don't bump your post frequently. One polite check after a few days is helpful, but bumping several times in the same day will actually bury your post and make it less likely to by noticed and answered.

    --Rob (on my phone,so I can't try to repro. Sorry)

    Monday, October 7, 2013 2:57 PM
    Moderator
  • Please don't bump your post frequently. One polite check after a few days is helpful, but bumping several times in the same day will actually bury your post and make it less likely to by noticed and answered.

    --Rob (on my phone,so I can't try to repro. Sorry)

    Sorry for that. 

    Up.

    Wednesday, October 9, 2013 10:37 AM
  • Hi Oleg,

    I still have not had time to look at this.  Maybe sometime today or tomorrow.  (or perhaps some of your peers will look at this for your)  If this is urgent please ask for support through our support channels.

    Jeff


    Jeff Sanders (MSFT)

    @jsandersrocks - Windows Store Developer Solutions @WSDevSol
    Getting Started With Windows Azure Mobile Services development? Click here
    Getting Started With Windows Phone or Store app development? Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)

    Wednesday, October 9, 2013 12:14 PM
    Moderator
  • Hi Oleg,

    I was able to run your repro.

    This appears to be a bug in 8.0 that is fixed in 8.1.  How important is this for you to be fixed or workaround in 8.0 (knowing that 8.1 will soon be publically available)?

    Jeff


    Jeff Sanders (MSFT)

    @jsandersrocks - Windows Store Developer Solutions @WSDevSol
    Getting Started With Windows Azure Mobile Services development? Click here
    Getting Started With Windows Phone or Store app development? Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)

    Wednesday, October 9, 2013 1:13 PM
    Moderator
  • Hello Jeff, thanks for reply.

    A lot of people use my app in w8.0. So it's very important :(

    Wednesday, October 9, 2013 1:51 PM
  • OK Oleg,

    I will see if I can come up with a workaround for you!

    Jeff


    Jeff Sanders (MSFT)

    @jsandersrocks - Windows Store Developer Solutions @WSDevSol
    Getting Started With Windows Azure Mobile Services development? Click here
    Getting Started With Windows Phone or Store app development? Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)

    Wednesday, October 9, 2013 1:58 PM
    Moderator
  • Oleg - try out this code:
     private async void Button_Click(object sender, RoutedEventArgs e)
            {
                test.ItemsSource = null;
                this.model.Items.RemoveAt(this.model.Items.Count - 1);
                await Dispatcher.RunAsync(
                    Windows.UI.Core.CoreDispatcherPriority.Normal,
                    () =>
                        {
                            test.ItemsSource = this.model.Items;
                        });
            }


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by Oleg Kurzov Thursday, October 10, 2013 3:03 PM
    Thursday, October 10, 2013 2:24 PM
    Moderator
  • Thank you, Matt. But now when I set test.ItemsSource in second time after removing item, my flipview hide left arrow "<"

    Also, I don't understand why removing don't work without UI thread synchronization? (Dispatcher.RunAsync).


    Thursday, October 10, 2013 3:03 PM
  • Truthfully, I don't either.  I know that this code is kind of weird.  What you're seeing there is that the Flipview displays 8, but it's actually on 0.  I haven't figured it out yet.

    I think there's a timing issue here, which is why I was using the dispatcher.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, October 10, 2013 3:27 PM
    Moderator