New to Telerik UI for .NET MAUIStart a free 30-day trial

Using Data Annotations in Telerik UI for .NET MAUI DataForm

Updated on Apr 10, 2026

Environment

VersionProductAuthor
13.0.0Telerik UI for .NET MAUI DataFormDobrinka Yordanova

Description

I want to use data annotations in the Telerik UI for .NET MAUI DataForm. Specifically, I need to know how to mark a field as required and how to specify placeholder text for an editor.

This knowledge base article also answers the following questions:

  • How to make a field required in Telerik MAUI DataForm?
  • How to set a placeholder text for an editor in Telerik MAUI DataForm?
  • What data annotations are available in Telerik MAUI DataForm?

Solution

To use data annotations in the Telerik UI for .NET MAUI DataForm, follow these steps:

  1. Add the [Required] attribute to mark a field as required. If the user tries to submit the form without filling it in, a validation error appears, and the submission is blocked.

  2. Use the [Display] attribute to customize the editor.

    • Name: Sets the editor header text.
    • GroupName: Defines the group name header.
    • Prompt: Specifies the placeholder text inside the editor.

The next example shows how to use data annotations for a required field in the .NET MAUI DataForm:

csharp
[Required] // Marks the field as required.
[Display(Name = "First Name", 
         GroupName = "Personal Information", 
         Prompt = "enter name")] 
// Name sets the header text. 
// GroupName sets the group's header text.
// Prompt sets the placeholder text in the input area.
public string FirstName
{
    get => this.name;
    set => this.UpdateValue(ref this.name, value);
}

See Also