New to Telerik UI for WinUI? Download free 30-day trial

Getting Started

This article will walk your through the creation of a sample application that contains RadDataForm.

Assembly References

In order to use the RadDataForm control in your projects, you have to add references to the Telerik.WinUI.Controls.dll assembly.

Using RadDataForm

To start using the control, you will need to initialize it and assign its ItemsSource property. The following example shows how to data bind the ItemsSource to a collection of custom objects.

Example 1: Defining the item model

public class DataInfo 
{ 
    public int Id { get; set; } 
    public string Name { get; set; } 
    public bool IsChecked { get; set; } 
    public DateTime Date { get; set; } 
    public MyEnum EnumValue { get; set; } 
} 
 
public enum MyEnum 
{ 
    ValueA, 
    ValueB 
} 

Example 2: Defining RadDataForm in XAML

<telerik:RadDataForm x:Name="dataForm"/> 

Example 3: Setting RadDataForm's ItemsSource

public MainWindow() 
{ 
    this.InitializeComponent(); 
 
    var source = new BindableCollection<DataInfo>(); 
    for (int i = 0; i < 10; i++) 
    { 
        source.Add(new DataInfo()  
        { 
            Id = i,  
            Name = "Item " + i, 
            IsChecked = i % 2 == 0, 
            Date = DateTime.Today.AddDays(i), 
            EnumValue = i % 2 == 0 ? MyEnum.ValueA : MyEnum.ValueB 
        }); 
    } 
    this.dataForm.ItemsSource = source; 
} 

Setting DataForm Header

The RadDataForm control provides a built-in header element displayed on top of the data fields. To enable this, set the Header property.

Example 4: Setting RadDataForm's Header

<telerik:RadDataForm Header="Data Form Header"/> 
In this article
Not finding the help you need?