Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to add ListView to ViewCell?

Hi, I am using XF 1.5.1.6455-pre1 in project for WindowsPhone 8.1 / Android solution.
I would like to show some list of parameters (variable for each list item) using this XAML code:

<ListView x:Name="ReadsListView" ItemsSource="{Binding ReadsList}" HasUnevenRows="True">
    <ListView.ItemTemplate>
        <DataTemplate>
            <ViewCell>
            <StackLayout Spacing="20">
                <StackLayout>
                    <ListView x:Name="ParamtersListView" ItemsSource="{Binding Item.ReadsParameters}"  >
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <TextCell Text="{Binding Name}" Detail="{Binding Value}"/>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>
                </StackLayout>
                </StackLayout>
            </ViewCell>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

It is run on Windows Phone 8.1 (Android will be developed and tested later) without errors, except that only first parameter is shown in ParamtersListView.
But ParamtersListView has height like all items were rendered (but not visible?).
I was trying almost everything - put ParamtersListView into StackLayouts and without them, using ViewCell and TexCell, set height of rows and not...
ALWAYS only first cell is rendered properly, rest are invisible, but take their own space.

What is going on?
Any solutions?

Tagged:
Sign In or Register to comment.