views:

8

answers:

0

Hello guys,

I've got a flat ADO.NET datatable that stores hierarchy. There is a data relation between fields ID and ParentID of the same table which describes hierarchy and there could be any number of levels.

I want to show hierarchy in WPF TreeView. I know that I should make unnamed HierarchicalDataTemplate with DataType: markup extension and everything should work automatically, but I cant't seem to reference my DataRow Type (if that is what I should reference).

DataRow is defined in separate assembly and I add:

xmlns:ds="clr-namespace:AbakusDataSet;assembly=AbakusDataSet"

inside a window definition in XAML. So, I can reference my dataset: ds:AbakusDataSet but when I try to reference my datarow: ds:AbakusDataSet.Z_ListRow or ds:Z_ListRow it simply won't accept it.

How can I achieve this, please? Or am I on a wrong track totally?