using System.Collections.Generic;
using System.Windows.Controls;

namespace RadGridViewTemplateBug {
    public partial class MainPage : UserControl {
        public MainPage() {
            InitializeComponent();

            var items = new List<Customer>();

            var c1 = new Customer();
            c1.CustomerName = "John Smith";
            c1.Orders = new List<Order>();
            var o1 = new Order();
            o1.OrderDescription = "BMW M3";
            o1.RelatedOrders = new List<Order>();
            c1.Orders.Add(o1);
            var ro1 = new Order();
            ro1.OrderDescription = "Audi S4";
            ro1.RelatedOrders = new List<Order>();
            o1.RelatedOrders.Add(ro1);
            items.Add(c1);

            radGridViewHierarchy.ItemsSource = items;
        }
    }

    public class Customer {
        public string CustomerName { get; set; }
        public List<Order> Orders { get; set; }
    }

    public class Order {
        public string OrderDescription { get; set; }
        public List<Order> RelatedOrders { get; set; }
    }
}
