locked
Can we load items in a gridview column-wise?

    Question

  • Hi All,

             The general patter of items loading in a GridView is row-wise.

       ex:-

               1  4  7

               2  5  8

               3  6  9

    But I need the items to be displayed in

              1  2  3

              4  5  6

              7  8  9.

    Can this be possible???

    Thursday, July 31, 2014 10:13 AM

Answers

  • Yes. But it depends page on scrolling. If you want to show "1 2 3" order without change collection order, just set

     
    ScrollViewer.HorizontalScrollMode="Disabled"
    ScrollViewer.VerticalScrollMode="Auto"

    in your collection control in xaml.

    For example, GridView:

    <GridView ScrollViewer.HorizontalScrollMode="Disabled"
              ScrollViewer.VerticalScrollMode="Auto"></GridView>
    If you still want to scroll page horizontally, you need to change your collection order in code. Try to calculate how many items will be in column and move your items in collection.

    Thursday, July 31, 2014 12:00 PM
  • Hi Rajesh,

    See my reply for another similar post:http://social.msdn.microsoft.com/Forums/windowsapps/en-US/4580046c-bf37-4ce4-b346-f755de00de55/horizontal-gridview-scroll-not-working?forum=winappswithcsharp#ccd69cf1-6fc0-42d5-8f4a-3f6002676148

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, August 07, 2014 8:24 AM
    Moderator

All replies

  • Yes. But it depends page on scrolling. If you want to show "1 2 3" order without change collection order, just set

     
    ScrollViewer.HorizontalScrollMode="Disabled"
    ScrollViewer.VerticalScrollMode="Auto"

    in your collection control in xaml.

    For example, GridView:

    <GridView ScrollViewer.HorizontalScrollMode="Disabled"
              ScrollViewer.VerticalScrollMode="Auto"></GridView>
    If you still want to scroll page horizontally, you need to change your collection order in code. Try to calculate how many items will be in column and move your items in collection.

    Thursday, July 31, 2014 12:00 PM
  • Hi Rajesh,

    See my reply for another similar post:http://social.msdn.microsoft.com/Forums/windowsapps/en-US/4580046c-bf37-4ce4-b346-f755de00de55/horizontal-gridview-scroll-not-working?forum=winappswithcsharp#ccd69cf1-6fc0-42d5-8f4a-3f6002676148

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, August 07, 2014 8:24 AM
    Moderator