So, I have have dragged an UltraTree control onto a winform. I have a bindinglist filling the datasource and it all works fine. I have changed the NodeStyle to checkbox thinking the +/- icons would change to checkboxes but it did nothing.
What am I doing wrong?
Thanks
-Ken
Hi Ken,
NodeStyle has no effect on the expansion indicators. What it does is put a checkbox in front of the node in standard ViewStyle.
If you are binding the tree, then the tree's ViewStyle will default to Grid style, so the NodeStyle is ignored in that case. If you want CheckBox in a grid-style tree, you will need to add an unbound column whose DataType is Boolean and use that.
I desire the same thing as in the above posts. I would like my Tree NodeStyle = CheckBox. I manually constructed the tree nodes and columns. My UltraTree is of form FreeForm.
Thank you,
Jean-Claude
Hi Jean-Claude,
All you have to do is set the DataType on the column to bool, as I said above. What part of this is still giving you trouble?
I did set my column DataType to Boolean. But I did not see a checkbox before or after my nodes. Is there a sample code you can refer me to?
Here is my code:
// Is this column an unbound column? if Not how to create an unbound column?
UltraTreeNodeColumn
col = new UltraTreeNodeColumn();
col.DataType =
Type.GetType("System.Boolean");
Hi,
I'm a little confused. The code you have here is right, except that you are not doing anything with this column, like adding it to the ColumnSet that the tree is using. I assume you are doing that in your application and you just didn't post it here?
You wrote that you are manually constructing your tree nodes and columns, so this is simply a matter of adding another column and setting it's DataType - just like you presumably did with all of the other columns.