New to Telerik UI for WPFStart a free 30-day trial

Integrate RadDataForm with RadGridView

Updated on Sep 24, 2025

The RadDataForm is may be fully integrated with the RadGridView control. A great implementation would be to benefit from it in the RowDetails representation.

For the purpose of this tutorial we will first create a class - Employee. In order to update the items of the grid once the corresponding field in the RadDataForm has been changed, we will implement the INotifyPropertyChanged Interface.

Example 1: Creating an Employee class that implements INotifyPropertyChanged

C#
	public class Employee : INotifyPropertyChanged
	{
	    public event PropertyChangedEventHandler PropertyChanged;
	    private string firstName;
	    private string lastName;
	    private string ocupation;
	    private DateTime startingDate;
	    private bool isMarried;
	    public string FirstName
	    {
	        get { return this.firstName; }
	        set
	        {
	            if (value != this.firstName)
	            {
	                this.firstName = value;
	                this.OnPropertyChanged("FirstName");
	            }
	        }
	    }
	    public string LastName
	    {
	        get { return this.lastName; }
	        set
	        {
	            if (value != this.lastName)
	            {
	                this.lastName = value;
	                this.OnPropertyChanged("LastName");
	            }
	        }
	    }
	    public string Ocupation
	    {
	        get { return this.ocupation; }
	        set
	        {
	            if (value != this.ocupation)
	            {
	                this.ocupation = value;
	                this.OnPropertyChanged("Ocupation");
	            }
	        }
	    }
	    public DateTime StartingDate
	    {
	        get { return this.startingDate; }
	        set
	        {
	            if (value != this.startingDate)
	            {
	                this.startingDate = value;
	                this.OnPropertyChanged("StartingDate");
	            }
	        }
	    }
	    public bool IsMarried
	    {
	        get
	        {
	            return this.isMarried;
	        }
	        set
	        {
	            if (this.isMarried != value)
	            {
	                this.isMarried = value;
	                this.OnPropertyChanged("IsMarried");
	            }
	        }
	    }
	    private int salary;
	    public int Salary
	    {
	        get
	        {
	            return this.salary;
	        }
	        set
	        {
	            if (this.salary != value)
	            {
	                this.salary = value;
	                this.OnPropertyChanged("Salary");
	            }
	        }
	    }
	    public Employee()
	    { }
	    protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
	    {
	        PropertyChangedEventHandler handler = this.PropertyChanged;
	        if (handler != null)
	        {
	            handler(this, args);
	        }
	    }
	    private void OnPropertyChanged(string propertyName)
	    {
	        this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
	    }
	    public static ObservableCollection<Employee> GetEmployees()
	    {
	        ObservableCollection<Employee> employees = new ObservableCollection<Employee>();
	        employees.Add(new Employee() { FirstName = "Sarah", LastName = "Blake", Ocupation = "Supplied Manager", StartingDate = new DateTime(2005, 04, 12), IsMarried = true, Salary = 3500 });
	        employees.Add(new Employee() { FirstName = "Jane", LastName = "Simpson", Ocupation = "Security", StartingDate = new DateTime(2008, 12, 03), IsMarried = true, Salary = 2000 });
	        employees.Add(new Employee() { FirstName = "John", LastName = "Peterson", Ocupation = "Consultant", StartingDate = new DateTime(2005, 04, 12), IsMarried = false, Salary = 2600 });
	        employees.Add(new Employee() { FirstName = "Peter", LastName = "Bush", Ocupation = "Casheer", StartingDate = new DateTime(2005, 04, 12), IsMarried = true, Salary = 2300 });
	        return employees;
	    }
	}

The definition of the of the RadGridView may be as follows:

Example 2: Defining the RadGridView

XAML
	<telerik:RadGridView x:Name="RadGridView1" IsReadOnly="True" ItemsSource="{Binding Employees}" 
	                     CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" 
	                     Height="500"  Width="700"
	                     RowDetailsVisibilityMode="VisibleWhenSelected">
	    <telerik:RadGridView.RowDetailsTemplate>
	        <DataTemplate>
	            <telerik:RadDataForm x:Name="myRadDataForm" CurrentItem="{Binding}" Header="Edit Employee:" />
	        </DataTemplate>
	    </telerik:RadGridView.RowDetailsTemplate>
	</telerik:RadGridView>

Afterwards, all you have to do is to set the ItemsSource of the grid:

Example 3: Setting the RadGridView's ItemsSource

C#
	this.RadGridView1.ItemsSource = Employee.GetEmployees();

Once you define all the required parts, you will see the following:

Figure 1: RadDataForm integrated with RadGridView

RadDataForm integrated with RadGridView

As mentioned previously, the implementation of the INotifyPropertyChanged Interface ensures that the changes made while editing with the RadDataForm will be immediately reflected in the corresponding item.

Not finding the help you need?
Contact Support