An open API service indexing awesome lists of open source software.

https://github.com/syncfusionexamples/gridlayout-with-xamarin.forms-listview

This sample show case the grid layout in listview xamarin.forms
https://github.com/syncfusionexamples/gridlayout-with-xamarin.forms-listview

grid-layout sflistview xamarin-forms xamarin-listview xforms

Last synced: 8 months ago
JSON representation

This sample show case the grid layout in listview xamarin.forms

Awesome Lists containing this project

README

          

# GridLayout with xamarin.forms listview
This sample show case the grid layout in listview xamarin.forms

## Sample

```xaml




. . .
. . .


C#:
protected override void OnSizeAllocated(double width, double height)
{
base.OnSizeAllocated(width, height);
try
{
base.OnSizeAllocated(width, height);

if (width > 0 && pageWidth != width)
{
var size = Application.Current.MainPage.Width / listView.ItemSize;
var gridLayout = listView.LayoutManager as GridLayout;
gridLayout.SpanCount = (int)size;
listView.LayoutManager = gridLayout;
}
}
catch (Exception ex)
{

}
}
```
## Requirements to run the demo

* Xamarin add-ons for Visual Studio (available via the Visual Studio installer).

## Troubleshooting

### Path too long exception

If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project.