I fear I'm missing something obvious, but to make use of your control I (1) added it to my toolbox, (2) dropped it onto my form, and (3) added the following code to the form load handler for testing:
TreeModel Model = new TreeModel();
Node RootNode = new Node("My Big Testing Root Node");
Model.Nodes.Add(RootNode);
When I run the sample application, the control appears, and it has a root, but the root has no text. Adding child nodes results in the same thing; i.e., I can expand the root and it will show the correct number of children, but no text appears. Can anyone offer me advice as to what I may be doing wrong? I'm using this with Visual Studio 2005. Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had the same problem, but the visual property explorer gave the following error:
The value "NodeTextBox" is not a type "Aga.Controls.Tree.NodeControls.NodeControl" and
cannot be used in this generic collection.
Parameter name: value.
instead I wrote the following code to get a basic example working:
NodeTextBox tb = new NodeTextBox();
tb.DataPropertyName = "Text";
treeViewAdv1.NodeControls.Add(tb);
TreeModel model = new TreeModel();
for (int i = 0; i < 5; i++)
{
Node n = new Node("abc " + i.ToString());
model.Nodes.Add(n);
}
this.treeViewAdv1.Model = model;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You also have to set the ParentColumn member in the node to be the name of the column you want your text in. Your Text is invisible if ParentColumn is blank
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"The value "NodeTextBox" is not a type "Aga.Controls.Tree.NodeControls.NodeControl" and
cannot be used in this generic collection.
Parameter name: value. "
Restart Visual Studio to get it to work. (Will only work for a while, you have to restart again later)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I fear I'm missing something obvious, but to make use of your control I (1) added it to my toolbox, (2) dropped it onto my form, and (3) added the following code to the form load handler for testing:
TreeModel Model = new TreeModel();
Node RootNode = new Node("My Big Testing Root Node");
Model.Nodes.Add(RootNode);
treeViewAdv1.BeginUpdate();
treeViewAdv1.Model = Model;
treeViewAdv1.EndUpdate();
When I run the sample application, the control appears, and it has a root, but the root has no text. Adding child nodes results in the same thing; i.e., I can expand the root and it will show the correct number of children, but no text appears. Can anyone offer me advice as to what I may be doing wrong? I'm using this with Visual Studio 2005. Thanks!
Bump?
Bump for another user!
You have to add a nodeTextBox in your nodeCollection and set the nodeTextBox dataProperty to "Text".
It can be done via the visual property explorer.
I had the same problem, but the visual property explorer gave the following error:
The value "NodeTextBox" is not a type "Aga.Controls.Tree.NodeControls.NodeControl" and
cannot be used in this generic collection.
Parameter name: value.
instead I wrote the following code to get a basic example working:
NodeTextBox tb = new NodeTextBox();
tb.DataPropertyName = "Text";
treeViewAdv1.NodeControls.Add(tb);
TreeModel model = new TreeModel();
for (int i = 0; i < 5; i++)
{
Node n = new Node("abc " + i.ToString());
model.Nodes.Add(n);
}
this.treeViewAdv1.Model = model;
You also have to set the ParentColumn member in the node to be the name of the column you want your text in. Your Text is invisible if ParentColumn is blank
Thanks, I had the blank node problem as well as the visual designer throwing an error message, and this bit you wrote worked:
NodeTextBox tb = new NodeTextBox();
tb.DataPropertyName = "Text";
treeViewAdv1.NodeControls.Add(tb);
Cheers!
"The value "NodeTextBox" is not a type "Aga.Controls.Tree.NodeControls.NodeControl" and
cannot be used in this generic collection.
Parameter name: value. "
Restart Visual Studio to get it to work. (Will only work for a while, you have to restart again later)
I encountered the same problem also, and it is very hard to figure it out until I read this discussion. Thank you very much!
BTW. Is there any documentation for the library?