Hi,
Lets say I have Collection of items with
public String Group { set; get; }
What would be the best way to bind this collection to TreeView while each item will be under his group, and the groups will be like folders?
For example:
Data = [ {Item1,GroupA} , {Item2,GroupA} , {Item3,GroupB} ]
Tree:
> GroupA
> Item1
> Item2
> GroupB
> Item3
Thanks! :D
Hello,
I'm just checking your progress on the issue that you are having.
If you require further assistance please do not hesitate to ask.
Hi guypld,
I don't think there is a feasible way to feed this collection to the XamDataTree and get the desired layout. So you'll have to transform this collection to be a bit more Data Tree friendly. Something like the following:
public class Group{ public string GroupName { get; set; } public IEnumerable<Item> {get; set;}}
public class Item{ public string ItemName { get; set; }}
Then you would have to define two NodeLayouts. For example:
<ig:NodeLayout Key="someKeyHere" TargetTypeName="Group" DisplayMemberPath="GroupName"></ig:NodeLayout>
<ig:NodeLayout Key="Children" TargetTypeName="Item" DisplayMemberPath="ItemName"></ig:NodeLayout>
Here is an article describing in detail how the node layouts are functioning and how to configure them to achieve the desired outcome.
Let me know if I could be of further help with this matter.