I am trying to create a treeview from a self-referential table, with a format like:
Id Name ParentId
1 Item1 null
2 Item2 null
3 Item1.1 1
4 Item1.2 1
However, when I try to use this data, I get an error that "A parent item with key '1' could not be found". I am debugging and intercepting the data being returned in the GetDataAsync procedure, and can confirm that each item has a matching ParentId (or null).
It looks like the parent items have to appear before any child items in the list? This is pretty awkward, especially if we are going to be rearranging items within the tree.
Is there example code of how we're supposed to bind to this type of data. The file explorer demo is cool, but a good example of binding to a self-referential table with int keys would be more useful.
I am trying to create a treeview from a self-referential table, with a format like:
However, when I try to use this data, I get an error that "A parent item with key '1' could not be found". I am debugging and intercepting the data being returned in the GetDataAsync procedure, and can confirm that each item has a matching ParentId (or null).
It looks like the parent items have to appear before any child items in the list? This is pretty awkward, especially if we are going to be rearranging items within the tree.
Is there example code of how we're supposed to bind to this type of data. The file explorer demo is cool, but a good example of binding to a self-referential table with int keys would be more useful.