WIth .net 7 Footer/Header and the Data Template not expanding over the whole screen width
For the Header I tested the code snipped from you example, just to verify, I didn't miss anything
My code:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:listview="clr-namespace:Syncfusion.Maui.ListView;assembly=Syncfusion.Maui.ListView"
x:Class="CycleProCut.Views.User"
xmlns:viewmodel="clr-namespace:CycleProCut.ViewModels"
xmlns:resx="clr-namespace:CycleProCut.Strings"
x:DataType="viewmodel:UserSetupViewModel"
Background="{DynamicResource WhiteSmoke20}"
Title="User">
<ContentPage.BindingContext>
<viewmodel:UserSetupViewModel/>
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem x:Name="IsMetric" Text="{Binding Metric, Mode=TwoWay}" />
<ToolbarItem Command="{Binding AddItemCommand}" Text="{x:Static resx:AppResources.Add}" />
</ContentPage.ToolbarItems>
<listview:SfListView x:Name="listView"
AutoFitMode="DynamicHeight"
SelectedItem="{Binding SelectedItem}"
ItemsSource="{Binding UserCollection}"
IsStickyHeader="True" IsStickyFooter="True"
EmptyView="No Items">
<listview:SfListView.HeaderTemplate>
<DataTemplate>
<Grid BackgroundColor="#4CA1FE" HeightRequest="60">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="2" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="2" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="2" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="1" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >
<Label x:Name="info" BackgroundColor="Transparent" Text="Informations" FontAttributes="Bold" FontSize="18" TextColor="White"
HorizontalTextAlignment="Center" VerticalTextAlignment="Center" />
</Grid>
<Grid Grid.Column="3" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >
<Label x:Name="status" BackgroundColor="Transparent" Text="Status" FontAttributes="Bold" FontSize="18" TextColor="White"
HorizontalTextAlignment="Center" VerticalTextAlignment="Center" />
</Grid>
<Grid Grid.Column="5" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" >
<Label x:Name="contacts" BackgroundColor="Transparent" Text="Contacts" FontAttributes="Bold" FontSize="18" TextColor="White"
HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
</Grid>
<BoxView Grid.Column="0" BackgroundColor="White" />
<BoxView Grid.Column="2" BackgroundColor="White" />
<BoxView Grid.Column="4" BackgroundColor="White" />
<BoxView Grid.Column="6" BackgroundColor="White" />
</Grid>
</DataTemplate>
</listview:SfListView.HeaderTemplate>
<listview:SfListView.FooterTemplate>
<DataTemplate>
<Grid BackgroundColor="{AppThemeBinding Light={StaticResource ButtomBackgroundLight}, Dark={StaticResource ButtomBackgroundDark}}" HeightRequest="60" >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Command="{Binding EditCommand}" WidthRequest="120" HeightRequest="40" BackgroundColor="LightGrey" CornerRadius="5" Grid.Column="0" Text="Edit"/>
<ImageButton Command="{Binding AddCommand}" BackgroundColor="Transparent" Source="add.png" Grid.Column="1"/>
<Button Command="{Binding DeleteCommand}" WidthRequest="120" HeightRequest="40" BackgroundColor="LightSalmon" CornerRadius="5" Grid.Column="2" Text="Delete" />
</Grid>
</DataTemplate>
</listview:SfListView.FooterTemplate>
<listview:SfListView.ItemTemplate>
<DataTemplate>
<Border
Margin="10"
Stroke="{AppThemeBinding Light={StaticResource FrameBorderLight}, Dark={StaticResource FrameBorderLightDark}}"
Background="{AppThemeBinding Light={StaticResource FrameBackgroundLight}, Dark={StaticResource FrameBackgroundDark}}"
StrokeThickness="2"
Padding="30,20"
HorizontalOptions="Center">
<Border.StrokeShape>
<RoundRectangle CornerRadius="0,20,20,0"/>
</Border.StrokeShape>
<Border.Shadow>
<Shadow Brush="Black"
Radius="5"
Opacity="0.4" />
</Border.Shadow>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<Label Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding DriverName}" FontAttributes="Bold" TextColor="Black" FontSize="20" />
<Label Grid.Column="3" Grid.ColumnSpan="2" Text="{Binding Team}" TextColor="Red" HorizontalTextAlignment="End" FontSize="Small" />
<BoxView
Grid.Column="1" Grid.ColumnSpan="4" Grid.Row="1"
BackgroundColor="Silver"
HeightRequest="1"
HorizontalOptions="FillAndExpand" />
<StackLayout Spacing="5" Orientation="Horizontal" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2">
<Label Text="{Binding UserName}" TextColor="DarkGray" FontSize="15"/>
<Label Text="{Binding SurName}" TextColor="DarkGrey" FontSize="15"/>
</StackLayout>
<Label Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="3" Text="{Binding UserDescription}" TextColor="Gray" FontSize="15"/>
</Grid>
</Border>
</DataTemplate>
</listview:SfListView.ItemTemplate>
</listview:SfListView>
</ContentPage>
Thanks for any help,
Hi Markus,
We would like to let you know that we have already faced the issue at our end, We have logged the bug report at our end and currently working on it.We will fix the issue and included the fix in our upcoming Vol1 SP release. Soon we will update you with the release date. We will appreciate you patience until then.
Regards,
Suthi Yuvaraj.
Thank you :) for your fast reply. Looking forward to Vol1 SP
Markus,
We are glad to announce that our Essential Studio 2023 Volume 1 Service Pack Release V21.2.3 is rolled out, we have fixed the reported issue “Listview with .net 7 not spanning over the whole screen width” and included the fix in this release, which is available for download under the following link.
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.