locked
Scrolling GridView vertically problem RRS feed

  • Question

  • I use a gridview with 31x12 items, it's basically a calendar. To make months rows and days columns I set a height of a gridview  to a fixed height and put the gridview in a scrollviewer. Works fine when scrolling horizontally, but when I want to scroll vertically, I select/deselect the items instead of scrolling them. Is there a way to change that? Thanks.
    Wednesday, October 2, 2013 2:43 PM

Answers

  • Hi Rob,

    GridView.IsSwipeEnabled = false did the trick at least in simulator, but it should be the same with the tablet. Now user cannot deselect an item, but that's fine, he can select something else or leave it.

    Ivan

    • Marked as answer by IvanIL Thursday, October 3, 2013 7:00 AM
    Thursday, October 3, 2013 6:59 AM

All replies

  • If you want a static shaped grid you'll be better off with a Grid than a GridView. The GridView really isn't designed for that.

    You can turn off selection, but there isn't a good way to both handle the Pointer events within the GridView (to allow selection, its scrolling, etc.) and outside the GridView (to allow the external scroll).

    --Rob

    Wednesday, October 2, 2013 2:58 PM
    Moderator
  • I used a GridView, because I need a single selection and having an object for each day of the year is what I need. I select one day and then do changes to it that are reflected in the item's label, colour, etc. All works nice, but it seems rather slow to load. I am thinking about the Grid. I am not sure how to represent one item. A ToggleButton perhaps? That could work, creating the items in code behind and binding them manually to viewmodel. I'll see. I just thought I almost had it done already :)

    Ivan

    Wednesday, October 2, 2013 6:23 PM
  • Hi Rob,

    GridView.IsSwipeEnabled = false did the trick at least in simulator, but it should be the same with the tablet. Now user cannot deselect an item, but that's fine, he can select something else or leave it.

    Ivan

    • Marked as answer by IvanIL Thursday, October 3, 2013 7:00 AM
    Thursday, October 3, 2013 6:59 AM