J
Jeff
hi
I have a generic collection I want to display inside a TreeView control
This is how my class look like:
public class Comment
{
private Guid _id;
private Guid _userid;
private Guid _article;
private Guid _parent;
private List<Comment> _replies;
public comment() {}
}
from what I understand I have to implement the IHierarchicalEnumerable
interface:
So I started with implementing the GetHierarchyData method:
public IHierarchyData GetHierarchyData(object enumeratedItem)
{
return enumeratedItem as IHierarchyData;
}
But I'm unsure how to implement the GetEnumerator method
How should I implement GetEnumerator and is GetHierarchyData implemented
correctly?
I have a generic collection I want to display inside a TreeView control
This is how my class look like:
public class Comment
{
private Guid _id;
private Guid _userid;
private Guid _article;
private Guid _parent;
private List<Comment> _replies;
public comment() {}
}
from what I understand I have to implement the IHierarchicalEnumerable
interface:
So I started with implementing the GetHierarchyData method:
public IHierarchyData GetHierarchyData(object enumeratedItem)
{
return enumeratedItem as IHierarchyData;
}
But I'm unsure how to implement the GetEnumerator method
How should I implement GetEnumerator and is GetHierarchyData implemented
correctly?