# .NET MAUI DataForm VerticalStackLayout Definition

The `DataFormVerticalStackLayout` definition allows you to arrange the items in a vertical stack layout.

Use the `Spacing`(`double`) property to specify the spacing in pixels between the items in the layout. Default value is `24`.

![.NET MAUI DataForm Stack Layout Definition](https://www.telerik.com/maui-ui/documentation/assets/488f1470717f6ae68b2164f7cfab8d02/dataform-verticalstack-layout-desktop.png)

Here is the DataForm XAML definition with `DataFormVerticalStackLayout` applied:

```XAML
<telerik:RadDataForm x:Name="dataForm">
    <telerik:RadDataForm.LayoutDefinition>
        <telerik:DataFormVerticalStackLayout Spacing="30"/>
    </telerik:RadDataForm.LayoutDefinition>
    <telerik:RadDataForm.BindingContext>
        <local:EditorsViewModel/>
    </telerik:RadDataForm.BindingContext>
</telerik:RadDataForm>
```

Note that `local` in the snippet above points to the namespace where the `EditorsViewModel` is defined.

The `ViewModel` used for the DataForm editors:

```C#
public class EditorsViewModel : NotifyPropertyChangedBase
{
    private string name;
    private DateTime? startDate;
    private DateTime? endDate;
    private double? people;
    private bool? visited;
    private TimeSpan? duration;
    private EnumValue accommodation = EnumValue.Apartment;
    public enum EnumValue
    {
        SingleRoom,
        Apartment,
        House
    }

    [Required]
    [Display(Name = "Select accomodation")]
    public EnumValue Accommodation
    {
        get
        {
            return this.accommodation;
        }
        set
        {
            if (this.accommodation != value)
            {
                this.accommodation = value;
                this.OnPropertyChanged();
            }
        }
    }

    [Required]
    [Display(Name = "First Name")]
    public string FirstName
    {
        get => this.name;
        set => this.UpdateValue(ref this.name, value);
    }

    [Required]
    [Display(Name = "Start date")]
    public DateTime? StartDate
    {
        get => this.startDate;
        set => this.UpdateValue(ref this.startDate, value);
    }

    [Required]
    [Display(Name = "End Date")]
    public DateTime? EndDate
    {
        get => this.endDate;
        set => this.UpdateValue(ref this.endDate, value);
    }

    [Required]
    [Display(Name = "Number of People")]
    [Range(1, 10)]
    public double? People
    {
        get => this.people;
        set => this.UpdateValue(ref this.people, value);
    }

    [Display(Name = "Visited before")]
    public bool? Visited
    {
        get => this.visited;
        set => this.UpdateValue(ref this.visited, value);
    }

    [Display(Name = "Duration")]
    public TimeSpan? Duration
    {
        get => this.duration;
        set => this.UpdateValue(ref this.duration, value);
    }
}
```

> For a runnable example with the DataForm VerticalStackLayout scenario, see the [SDKBrowser Demo Application](https://www.telerik.com/maui-ui/documentation/demos-and-sample-apps/sdkbrowser-app) and go to **DataForm > Layouts** category.

## See Also

* [Grid Layout](https://www.telerik.com/maui-ui/documentation/controls/dataform/layouts/grid)
* [Custom Layout](https://www.telerik.com/maui-ui/documentation/controls/dataform/layouts/custom)
