private Node AddProductChild(Node parent) { Node node = new PartNode("Child Node " + parent.Nodes.Count.ToString()); parent.Nodes.Add(node); return(node); }
private Node AddRoot() { Node node = new PartNode("Long Root Node Text" + _model.Nodes.Count.ToString()); _model.Nodes.Add(node); return(node); }
//protected override void OnRowDraw(PaintEventArgs e, TreeNodeAdv node, DrawContext context, int row, Rectangle rowRect) //{ // base.OnRowDraw(e, node, context, row, rowRect); // if (node.Tag != null) // { // if (node.Tag.GetType() == typeof(PartNode)) // { // PartNode pnode = node.Tag as PartNode; // if (pnode.Nodes.Count > 0 && pnode.Index % 2 == 0) // context.ForeColor = Color.Red; // } // } //} protected override void CheckNodeState(TreeNodeAdv node, ref DrawContext context) { if (node.Tag != null) { if (node.Tag.GetType() == typeof(PartNode)) { PartNode pnode = node.Tag as PartNode; if (pnode.Nodes.Count > 0 && pnode.Index % 2 == 0) { context.ForeColor = Color.Red; } } } }