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

Unable to use a grid within a DataTemplate

$
0
0

I am unable to use a grid within a DataTemplate.
Specifically, text does not get rendered when using a grid.

    <ListView ItemsSource="{Binding Services}">
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <ViewCell.View>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>

                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>

                                <Label Grid.Row="0" Grid.ColumnSpan="2"  Text="{Binding Name}" />
                                <Label Grid.Row="1" Grid.Column="0" Text="Labor:" />
                                <Label Grid.Row="1" Grid.Column="1" Text="{Binding LaborCost}" />

                                <Label Grid.Row="2" Grid.Column="0" Text="Materials:" />
                                <Label Grid.Row="2" Grid.Column="1" Text="{Binding Materials, Converter={StaticResource MaterialsToCostConverter}}" />

                                <Label Grid.Row="3" Grid.ColumnSpan="2" Text="{Binding Description}" />
                            </Grid>
                    </ViewCell.View>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

Any suggestions?


Viewing all articles
Browse latest Browse all 75885

Trending Articles



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