Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to bind multiple rows and columns to the list view?

$
0
0

my list view containing grid, i need to bind dynamically a multiple rows and columns inside the grid.

(Grid.Row and Grid.column values are getting from the list view)

This is my xaml code:

<ListView x:Name="xxxx" HasUnevenRows="True" SeparatorVisibility="None" VerticalOptions="FillAndExpand">
    <ListView.ItemTemplate>
        <DataTemplate>
            <ViewCell>
                <Grid BackgroundColor="White">
                   <Image Source = {Binding image} Grid.Row = {Binding rowNo} Grid.Column = {Binding columnNo}/>
                </Grid>
            </ViewCell>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

This is my cs:

new item { image = "x.png", rowNo = "1", columnNo = "0"}

By using this im getting an output
(For Example: Grid.row =2 Grid.column =2
My output was :

            1         
                 1     
            1
                 1

Im getting it as a 4 line instead of getting it in a 2 lines)

how to resolve this???


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>