Home - Forums-.NET - FlyGrid.Net (Windows Forms) - FlyGrid equivalent to System.Windows.Forms.TreeNode().Tag ?

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

FlyGrid equivalent to System.Windows.Forms.TreeNode().Tag ?
Link Posted: 03-Aug-2006 18:23
What is the FlyGrid equivalent to System.Windows.Forms.TreeNode().Tag property? (I don't see it in the docs.) I want to store an object of mine with every TreeViewNode so that I can retrieve it when TreeViewNode is selected.

Thanks.
Link Posted: 03-Aug-2006 18:24
typo:

System.Windows.Forms.TreeNode().Tag

    should be

System.Windows.Forms.TreeNode.Tag
Link Posted: 03-Aug-2006 23:23
This property not inserted to the base TreeViewNode class to optimize memory usage, but you can use a simple following sample to use node with tag:
[c#]
public class TaggedTreeViewNode : TreeViewNode
{
  public TaggedTreeViewNode(object value) : base(value){}
  public TaggedTreeViewNode(object value, NodeState state) : base(value, state){}
  public TaggedTreeViewNode(object value, Node[] nodes) : base(value, nodes){}
  public TaggedTreeViewNode(object value, Node[] nodes, NodeState state) : base(value, nodes, state){}
  private object tag = null;
  [DefaultValue(null)]
  public object Tag
  {
    get
    {
      return tag;
    }
    set
    {
      tag = value;
    }
  }
}
Link Posted: 03-Aug-2006 23:32
Yes, thanks, that's what I figured... inheritence required.