# Configure the Groups in .NET MAUI DataForm

The DataForm control for .NET MAUI provides the following properties to configure and customize the groups appearance.

* `GroupName`(`string`)—Specified the unique name of the group.
* `Spacing`(`double`)—Specifies the spacing in pixels between the header view and the content view(where the editors are defined).

## Header

Each group has a header. Here are the properties you can use to configure the group header:

* `HeaderText`(`string`)—Specifies the text of the header.
* `HeaderImageSource`(`Microsoft.Maui.Controls.ImageSource`)—Specifies the image in the header.
* `HeaderDisplayOptions`(`Telerik.Maui.Controls.DataFormHeaderDisplayOptions`)—Specifies the display options of the header. The available options are:
  * `None`—Header image and text are not visualized.
  * `Text`—Visualizes the header text. For this option `HeaderText` has to be defined.
  * `Image`—Visualizes the image in the header. For this option `HeaderImageSource` has to be defined.

You can combine the `Text` and the `Image` in the `HeaderDisplayOption`:

```XAML
HeaderDisplayOptions="Image, Text"
```

Here is an example for defining Dataform header options:

```XAML
<telerik:DataFormGroup HeaderDisplayOptions="Text" 
                       Spacing="15"
                       HeaderText="Required Information"
                       HeaderImageSource="away.png">
    <telerik:DataFormRadEntryEditor PropertyName="FirstName"/>
    <telerik:DataFormRadNumericEditor PropertyName="People" Minimum="1" Maximum="10"/>
    <telerik:DataFormRadComboBoxEditor PropertyName="Accommodation" HeaderText="Accomodation options"/>
</telerik:DataFormGroup>
```

![.NET MAUI DataForm Groups Configuration](https://www.telerik.com/maui-ui/documentation/assets/3c43d9ab5f687ddd24e8262531959e06/dataform-groups-configuration-desktop.png)

## Layouts

DataForm supports different group layouts. You can apply a layout to a particular group by setting the `LayoutDefinition` property to the `DataFormGroup`. The available layouts are described in the [DataForm Layouts](https://www.telerik.com/maui-ui/documentation/controls/dataform/layouts/overview) article.

This is an example when the `DataFormGroup.LayoutDefinition` is set to `DataFormGridLayout`:

```XAML
<telerik:DataFormGroup HeaderDisplayOptions="None">
    <telerik:DataFormGroup.LayoutDefinition>
        <telerik:DataFormGridLayout ColumnCount="2"/>
    </telerik:DataFormGroup.LayoutDefinition>
    <telerik:DataFormRadTimeSpanPickerEditor PropertyName="Duration" HeaderText="Duration"/>
    <telerik:DataFormRadCheckBoxEditor PropertyName="Visited" HeaderText="Visited before"/>
</telerik:DataFormGroup>
```

## Templates

* `HeaderTemplate`(`Microsoft.Maui.Controls.ControlTemplate`)—Specifies the template of the header view.
* `ContentTemplate`(`Microsoft.Maui.Controls.ControlTemplate`)—Specifies the template of the content view. The view where the editors are defined.

Here is an example for defining Dataform `HeaderTemplate`:

```XAML
<telerik:DataFormGroup>
    <telerik:DataFormGroup.HeaderTemplate>
        <ControlTemplate>
            <HorizontalStackLayout Spacing="10" HorizontalOptions="Start">
                <Image Source="available.png"/>
                <Label Text="Select Dates" VerticalTextAlignment="Center"/>
            </HorizontalStackLayout>
        </ControlTemplate>
    </telerik:DataFormGroup.HeaderTemplate>
    <telerik:DataFormRadDatePickerEditor PropertyName="StartDate" HeaderText="From:"/>
    <telerik:DataFormRadDatePickerEditor PropertyName="EndDate" HeaderText="To:"/>
</telerik:DataFormGroup>
```

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

## Styling

You can customize the groups using the flexible styling API. For more details review the [Groups Styling](https://www.telerik.com/maui-ui/documentation/controls/dataform/styling/groups-styling) article.

## See Also

* [Editors](https://www.telerik.com/maui-ui/documentation/controls/dataform/editors/overview)
* [Commit Data](https://www.telerik.com/maui-ui/documentation/controls/dataform/commit-data)
* [Validation](https://www.telerik.com/maui-ui/documentation/controls/dataform/validation)
