Bind a multiple array to a listview

riccardo d'aria 1 Reputation point
2023-05-12T16:05:36.3066667+00:00

I need to bind to a listview a multiple array is it possible.

Other INFO please, is possible to scroll ohorizontally a lystview???

I had a very long day googling on those topic.

THANKS

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,647 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 39,391 Reputation points Microsoft Vendor
    2023-05-15T06:17:42.7633333+00:00

    Hello,

    For ListView, its ItemsSource only supports one IEnumerable object:

    A ListView is populated with data using the ItemsSource property, which can accept any collection implementing IEnumerable. - Quoted from ListView Data Sources.

    Therefore, you can not bind multiple arrays to it.

    Other INFO please, is possible to scroll ohorizontally a lystview???

    ListView does not provide APIs to change the scroll direction of the view, if you want to implement this feature, it is recommended that you use CollectionView.

    The CollectionView is a flexible and performant view for presenting lists of data using different layout specifications.

    For CollectionView, you could implement it via the following code:

    <CollectionView ItemsLayout="HorizontalList">
    ...
    </CollectionView>
    

    Please refer to Horizontal list for more details.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments