locked
GridView : How can i know the scroll bar reached the end

    Question

  • Hi ,

    I use the GridView to display 10 small images, when the user scrolled the GridView  to the last image i have to catch the event and show something to the user.  So, is there any way to check that ?

    Thanks !

    ( The images were loaded when the GridView is created so there will not dynamical loading.)

    Regards.

    Dong

    Tuesday, June 03, 2014 7:28 AM

Answers

  • It looks like the problem is that the ScrollBar's visibility will change as the ScrollViewer is used, so setting the initial setting won't be sufficient. You'll probably need to do some significant retemplating for that.

    Handling ViewChanged will both be easier and give you better behavior, so I would recommend going that route.

    --Rob

    • Marked as answer by wd0623 Thursday, June 12, 2014 4:45 AM
    Thursday, June 12, 2014 3:52 AM
    Owner

All replies

  • Can you explain in more detail what you are trying to do? Typically folks look for this for virtualization, but it sounds like that's not

    There isn't a direct event for this, although you could tap into the GridView's ScrollViewer's ViewChanged event.

    --Rob

    Tuesday, June 03, 2014 7:56 PM
    Owner
  • Can you explain in more detail what you are trying to do? Typically folks look for this for virtualization, but it sounds like that's not

    There isn't a direct event for this, although you could tap into the GridView's ScrollViewer's ViewChanged event.

    --Rob

    Thanks for your reply, Rob.  I have show some images on the bottom app bar and they should be scrollable. So i put a GridView in a StackPanel to hold the images.

     Why i need to know the scroll bar reached the end :  Before the user scrolls the images, there is no scroll bar is showing, so, the user may not aware those images could be scrollable. I put a picture behind the GridView to indicate there are some images besides the showing ones and i should remove it when the user scrolled to the end, and pop up another message to the user.

    I will try your suggestion, thanks ! 

    Regards.

    Dong.


    Wednesday, June 04, 2014 1:51 AM
  • Rob, if i can make the scrollbar always showing, the problem could be solved. But i haven't find the way.

    Wednesday, June 04, 2014 2:15 AM
  • Wednesday, June 04, 2014 2:55 AM
    Owner
  • You can set the HorizontalScrollBarVisibility property .

    I just had a try.  I set the property to 'Visible' but the scroll bar only appear during the scrolling.  I want to make it always visible. Did i missed something ?

    <Page.BottomAppBar>

    <AppBar>

    <GridView ScrollViewer.HorizontalScrollBarVisibility="Visible">

    <GridView.Items>

      <AppBarButton x:Uid="Camera" Icon="Camera" Label="Camera">

    <AppBarButton x:Uid="Add" Icon="Add" Label="Add">

                             ..................

     ...................

    </GridView.Items>

    </GridView>

    </AppBar>

    </Page.BottomAppBar>

    Wednesday, June 04, 2014 6:06 AM
  • It looks like the problem is that the ScrollBar's visibility will change as the ScrollViewer is used, so setting the initial setting won't be sufficient. You'll probably need to do some significant retemplating for that.

    Handling ViewChanged will both be easier and give you better behavior, so I would recommend going that route.

    --Rob

    • Marked as answer by wd0623 Thursday, June 12, 2014 4:45 AM
    Thursday, June 12, 2014 3:52 AM
    Owner