We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Grid.RowSpan Not Responding

In my .NET Maui program, I have a ContentPage with a DataGrid and DataForm. 

In my xaml, I'm trying to change the DataForm's Height by setting the Grid.RowSpan to Grid.RowSpan=3 for example.  However, the DataForm itself never changes height.   


Here is a code snippet:


  <StackLayout>

        <Label Text="Patient Page"

                   HorizontalOptions="Center"

                   TextColor="White"

                   VerticalOptions="Center"

                   BackgroundColor="#512BD4" />


        <Grid Padding="10,10,10,10">

            <Grid.RowDefinitions>

                <RowDefinition Height="*" />

                <RowDefinition Height="*" />

                <RowDefinition Height="*" />

                <RowDefinition Height="*" />

            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>

                <ColumnDefinition />

                <ColumnDefinition />

                <ColumnDefinition />

                <ColumnDefinition />

            </Grid.ColumnDefinitions>


            <dataForm:SfDataForm x:Name="patientDataForm" Grid.Row="0" Grid.RowSpan="3" Grid.Column="2" Grid.ColumnSpan="2"

                                  ColumnCount="2" />

            <!--DataObject="{Binding Patient}"-->


            <syncfusion:SfDataGrid x:Name="patientDataGrid" Grid.Row="0" Grid.RowSpan="0" Grid.Column="0" Grid.ColumnSpan="2"


How do I make the DataForm expand in size?  




1 Reply

SS SaiGanesh Sakthivel Syncfusion Team January 3, 2023 11:44 AM UTC

Hi Frederick


#Regarding Grid.RowSpan is not responding

As per the behavior of DataForm, if the height is set to infinity ( '*' or 'auto'), the DataForm will be rendered with the minimum height request. To increase the height of the DataForm, you can either increase the MinimumHeightRequest of DataForm or specify the grid row height using specific value. Please refer to the following code snippet for your reference.


Code Snippet

<StackLayout>

    <Label Text="Patient Page"

            HorizontalOptions="Center"

            TextColor="White"

            VerticalOptions="Center"

            BackgroundColor="#512BD4" />

    <Grid Padding="10,10,10,10" >

        <Grid.RowDefinitions>

            <RowDefinition Height="200" />

            <RowDefinition Height="100" />

            <RowDefinition Height="100" />

            <RowDefinition Height="20" />

        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>

            <ColumnDefinition />

            <ColumnDefinition />

            <ColumnDefinition />

            <ColumnDefinition />

        </Grid.ColumnDefinitions>

        <dataForm:SfDataForm x:Name="patientDataForm" DataObject="{Binding ContactsInfo}" Grid.ColumnSpan="2" ColumnCount="2" Grid.Row="0" BackgroundColor="LightYellow" Grid.RowSpan="3" Grid.Column="2" />

        <syncfusion:SfDataGrid x:Name="patientDataGrid" Grid.Row="0" Grid.RowSpan="1" Grid.Column="0" BackgroundColor="LightGreen" Grid.ColumnSpan="2"/>

    </Grid>

</StackLayout>


We have attached the testing sample in the following locations.

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/DataFormMAUI-1803009209


Please let us know if you have any concerns.


Regards,
SaiGanesh Sakthivel


Loader.
Live Chat Icon For mobile
Up arrow icon