# Getting Started with the .NET MAUI DataForm

This guide provides the information you need to start using the Telerik UI for .NET MAUI DataForm by adding the control to your project.

At the end, you will achieve the following result.

![DataForm Getting Started](https://www.telerik.com/maui-ui/documentation/assets/2a86d16434643c5a37492e795b9a349c/dataform-getting-started.png)

## Prerequisites

Before adding the DataForm, you need to:

1. [Set up your .NET MAUI application](https://www.telerik.com/maui-ui/documentation/get-started/quickstart#prerequisites).

2. [Set Up Telerik Development Environment](https://www.telerik.com/maui-ui/documentation/get-started/quickstart#set-up-telerik-development-environment)

## Define the Control

When your .NET MAUI application is set up, you are ready to add a DataForm control to your page. The following example demonstrates the definition of the `RadDataForm` with `ViewModel` defined.

**1.** Define the DataForm:

```XAML
<telerik:RadDataForm x:Name="dataForm" AutomationId="dataForm"/>
```

```C#
var dataForm = new RadDataForm();
		dataForm.BindingContext = new GettingStartedModel();
```

**2.** Define the `ViewModel`:

```C#
public class GettingStartedModel : NotifyPropertyChangedBase
{
    private string firstName;
    private string lastName;
    private DateTime? startDate;
    private TimeSpan? startTime;
    private double? people = 1;
    private bool visited;
    private TimeSpan? duration;
    private EnumValue accommodation = EnumValue.Apartment;
    public enum EnumValue
    {
        SingleRoom,
        Apartment,
        House
    }

    [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.firstName;
        set => this.UpdateValue(ref this.firstName, value);
    }

    [Required]
    [Display(Name = "Last Name")]
    public string LastName
    {
        get => this.lastName;
        set => this.UpdateValue(ref this.lastName, value);
    }

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

    [Display(Name = "Time")]
    public TimeSpan? EndDate
    {
        get => this.startTime;
        set => this.UpdateValue(ref this.startTime, value);
    }

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

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

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

> For the DataForm Getting Started example refer to the [SDKBrowser Demo Application](https://www.telerik.com/maui-ui/documentation/demos-and-sample-apps/sdkbrowser-app) and go to **DataForm > Getting Started** category.

## Additional Resources

* [.NET MAUI DataForm Product Page](https://www.telerik.com/maui-ui/dataform)
* [.NET MAUI DataForm Forum Page](https://www.telerik.com/forums/maui?tagId=1979)
* [Telerik .NET MAUI Blogs](https://www.telerik.com/blogs/mobile-net-maui)
* [Telerik .NET MAUI Roadmap](https://www.telerik.com/support/whats-new/maui-ui/roadmap)

## See Also

* [Editors](https://www.telerik.com/maui-ui/documentation/controls/dataform/editors/overview)
* [Grouping](https://www.telerik.com/maui-ui/documentation/controls/dataform/grouping/overview)
* [Headers](https://www.telerik.com/maui-ui/documentation/controls/dataform/headers)
* [Layouts](https://www.telerik.com/maui-ui/documentation/controls/dataform/layouts/overview)
* [Commit Data](https://www.telerik.com/maui-ui/documentation/controls/dataform/commit-data)
* [Commands](https://www.telerik.com/maui-ui/documentation/controls/dataform/commands)
