How to make the SfDataForm display at the top of the page?

I have a very simple page, containing grid with a dataform.

        <Grid ColumnDefinitions="0.6*, 0.4*" ColumnSpacing="20" VerticalOptions="Fill">
            <dataForm:SfDataForm x:Name="DataForm"
                                    AutoGenerateItems="False"
                                    LayoutType="TextInputLayout"
                                    CommitMode="LostFocus"
                                    DataObject="{Binding EditableSegment}">


                <dataForm:SfDataForm.TextInputLayoutSettings>
                    <dataForm:TextInputLayoutSettings ShowHelperText="True"/>
                </dataForm:SfDataForm.TextInputLayoutSettings>


            </dataForm:SfDataForm>
        </Grid>
The result is as follows:
  • when there's more space vertically than dataform needs, it's always vertically centered, leaving lots of empty space at the top; 
    
  • when there's less space, the vertical scroll bar appears (which is correct), but it doesn't allow to scroll to the end of the form
The empty space at the top:

Image_1749_1712571794404

The inadequate scroll at the bottom:

Image_6409_1712571302225
If it's of any importance, I add items to the datafrom from C# by setting DataForm.Item directly.

What is the solution or workaround to make it behave properly?

5 Replies

VM Vidyalakshmi Mani Syncfusion Team April 9, 2024 12:38 PM UTC

Hi Jacek,


Thank you for reaching out to us. Based on the information you provided, we have investigated your query. We created a simple sample incorporating the code snippets and details you shared. In our testing, we were able to scroll the dataform to the bottom editor without encountering any issues. Regarding the space at the top, we did not observe significant space at the top as shown in the image you shared.


We have attached the tested sample for your reference. Please review our sample and let us know if you are still experiencing the same issue. If not, please modify our sample according to your scenario to replicate the issue and share the modified sample with us. Alternatively, if you are unable to modify our sample, please provide us with the sample on which you are experiencing this issue. This will help us further investigate the problem and provide you with an accurate solution.


Regards,

Vidyalakshmi M.



Attachment: GettingStarted_7a1a6c29.zip


JB Jacek Brzezinski April 10, 2024 05:42 AM UTC

Hello,


Thank you for the answer. I have just started the example you sent without making any changes. You can see two issues on the video attached:

  • the view is centered vertically
  • when I resize the window, the scrollbar doesn't allow to see the last elements
The platform is Windows.
Can you suggest any workarounds for those issues?

Regards,
Jacek

Attachment: Desktop_2024.04.10__09.39.32.02_7377c0f7.zip


VO Vishal Omprasad Syncfusion Team April 10, 2024 01:20 PM UTC

Hi Jacek,

Regarding “unable to scroll dataform to the end”:

As per the shared details, we have checked the reported query with our previously shared sample and found that the scenario can be resolved at sample level. In the sample, we recommend setting "MinimumHeightRequest" for SfDataForm to "100", as shown in the following snippet.

[Code snippet]:

<dataForm:SfDataForm x:Name="DataForm"

                     Grid.Column="0"

                     MinimumHeightRequest="100"

                     AutoGenerateItems="False"

                     LayoutType="TextInputLayout"

                     CommitMode="LostFocus"

                     DataObject="{Binding ContactsInfo}">

We have shared the modified sample below for your reference.

Please check our sample and let us know whether your issue is resolved.

Regarding “more space at the top when maximizing the window”:

Currently we are analyzing your query. We will validate and update you with further details shortly. We appreciate your patience until then.

Regards,
Vishal O.


Attachment: GettingStarted_519f5dcf.zip


VO Vishal Omprasad Syncfusion Team April 12, 2024 12:43 PM UTC

Hi Jacek,

We have found and fixed the reported scenario “significant empty space at the top when maximizing the window in Windows platform” in the .NET MAUI SfDataForm control from our end. Currently, the issue fix is in the testing phase. Once the automation is ensured, we will include the issue fix in our upcoming weekly NuGet release update. We appreciate your patience until then.

Regards,
Vishal O.



VO Vishal Omprasad Syncfusion Team April 16, 2024 06:58 AM UTC

Hi Jacek,

We have fixed the reported issue “significant empty space at the top when maximizing the window in Windows platform” in the .NET MAUI SfDataForm control from our end and included the issue fix in our latest weekly NuGet release update version 25.1.40 which is available for download in nuget.org. Please update to the latest version to resolve this issue.

Nuget link: https://www.nuget.org/packages/Syncfusion.Maui.DataForm

Root-cause: Upon analyzing at source level, we have identified that the reported scenario was caused by a framework, release resulting in the scrollview’s position adjusting automatically upon window resizing.

Thank you for your support and patience in waiting for this update. Please feel free to reach out to us if you would require any further assistance.

Regards,
Vishal O.


Loader.
Up arrow icon