I have a self-referencing Hierarchy working fine in .NET Framework 4.8,
now I upgraded to .NET 8 with
UI.for.WinForms.AllControls.Net60 2022.2.808-hotfix
public partial class Form1 : Form
{
private Person[] _people = {
new Person() { ID=1, Parent =0, Name = "Hans"},
new Person() { ID=2, Parent =1, Name = "Fred"},
new Person() { ID=3, Parent =1, Name = "Mary"},
new Person() { ID=4, Parent =0, Name = "John"}
};
public Form1()
{
InitializeComponent();
radGridView1.Relations.AddSelfReference(radGridView1.MasterTemplate, nameof(Person.ID), nameof(Person.Parent));
radGridView1.DataSource = _people;
}
}
public class Person
{
public int ID { get; set; }
public int Parent { get; set; }
public string Name { get; set; }
}
Now, there are errors produced like "enumeration already finished".
Without this AddSelfReference, everything is fine. (just without the collapsable sections)
Setting DataSource first, doesn't make a difference either.
Something must have changed from the 4.8 to your 6.0 version.