Dynamic Location for Button after DataForm with Warnings Triggered
All the research I could find on how to control the height of a dataForm indicates a grid row definition set to auto would return 300 by default, no dynamic way. Making the dataForm a fixed height was the only solution I could find to keep my button from covering the confirmPassword field as the warnings on first 2 fields were raised. In cases where you are using warnings on the properties, the button on the next grid row doesn't move with the size change of the datForm. Looking at the 2 screen shots below, you can see the spacing on the button from last field is too far from ConfirmPassword field because it is allowing room for warnings. My XAML is b
My question is, Is there a better way?
<?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"
x:Class="AvalonEventTrackerApp.Views.ResetPasswordPage"
xmlns:local="clr-namespace:AvalonEventTrackerApp"
xmlns:dataform="clr-namespace:Syncfusion.Maui.DataForm;assembly=Syncfusion.Maui.DataForm"
xmlns:viewmodel="clr-namespace:AvalonEventTrackerApp.ViewModel"
x:DataType="viewmodel:ResetPasswordViewModel"
Title="Reset Password">
<ContentPage.Content>
<Grid RowDefinitions="285,*,Auto" Background="White">
<dataform:SfDataForm x:Name="resetPasswordForm"
DataObject="{Binding ResetPasswordModel}"
VerticalOptions="Start"
LayoutType="TextInputLayout"
ValidationMode="PropertyChanged"
CommitMode="PropertyChanged"
Grid.Row="0"
>
<dataform:SfDataForm.TextInputLayoutSettings>
<dataform:TextInputLayoutSettings
FocusedStroke="{StaticResource Primary}"/>
</dataform:SfDataForm.TextInputLayoutSettings>
</dataform:SfDataForm>
<HorizontalStackLayout Grid.Row="1"
VerticalOptions="Start"
HorizontalOptions="{OnPlatform iOS=Center, Android=Center}"
Margin="0,0,0,0">
<Button Text="Reset Password"
HorizontalOptions="Center"
CornerRadius="10"
VerticalOptions="Start"
WidthRequest="300"
HeightRequest="60"
FontSize="20"
FontAttributes="Bold"
TextColor="White"
Command="{Binding ResetPasswordCommand}"/>
</HorizontalStackLayout>
<BoxView Grid.Row="2" Background="White"/>
<Label Text="Avalon Event Tracker"
FontSize="24"
FontAttributes="Bold"
TextColor="{x:StaticResource Primary}"
VerticalOptions="End"
HorizontalOptions="Center"
Grid.Row="4"
Margin="0,0,0,0"
/>
</Grid>
</ContentPage.Content>
</ContentPage>
Hi Joseph,
Currently, the MAUI SfDataForm control does not have support to automatically adjust its height. We have logged a feature request for this and plan to implement it in one of our upcoming releases. We will notify you as soon as this feature is available.
You can track the progress using the following feedback link: Auto-adjust-height-for-sfdataform-to-fit-content
In the meantime, please feel free to contact us regarding any other features or issues using our Feature Report page.
Thank you for your patience and understanding.
Regards,
Sri Radhesh Nag S
- 1 Reply
- 2 Participants
-
JC Joseph Cigno
- May 14, 2025 04:10 PM UTC
- May 19, 2025 10:20 AM UTC