Hello I'm having a problem with DevExpress's TreeListView
I have the following classes:
public class EmployeeBase
{
public int Id { get; set; }
public string Name { get; set; }
}
public class Employee : EmployeeBase
{
public int ParentId { get; set; }
}
The following is my XAML:
<dxg:TreeListControl AutoPopulateColumns="True" ItemsSource="{Binding Employees}">
<dxg:TreeListControl.View>
<dxg:TreeListView KeyFieldName="Id" ParentFieldName="ParentId">
</dxg:TreeListView>
</dxg:TreeListControl.View>
</dxg:TreeListControl>
Code behind:
public ObservableCollection<EmployeeBase> Employees { get; set; }
public MainWindow()
{
InitializeComponent();
DataContext = this;
Employees = new ObservableCollection<EmployeeBase>(Rep.GetStuff());
}
When I run the application the treelistview shows the objects without children
If I change the Observable collection's type to Employee instead of employeee base the child nodes will be generated normally.
Is there any way to resolve this without adding the ParentId property to the base class?