I have an UltraTree (v 7.3) component on a windows form (VS 2005) that is bound to a .NET class with three properties (two string values and a boolean value).
The class structure is as follows:public class TreeHierarchy : List<HierarchyItem>{}public class HierarchyItem{}HierarcyItem contains the three properties Name(string), Type(string), Check(bool); and two methods: public List<HierarchyItem> Child, public void AddChild(HierarchyItem hierarchyItem)
I populate the above classes as follows, and bind them to the ultraTree in the form load event...TreeHierarchy treeHierarchy = new TreeHierarchy();HierarchyItem hi = new HierarchyItem("A", "", true);treeHierarchy.Add(hi);hi.AddChild(new HierarchyItem("the quick brown fox", "Add", false));hi.AddChild(new HierarchyItem("2", "Add", false));
hi = new HierarchyItem("B", "Delete", true);treeHierarchy.Add(hi);hi.AddChild(new HierarchyItem("1", "Delete", false));hi.AddChild(new HierarchyItem("2", "Add", true));
ultraTree1.DataSource = treeHierarchy;
The following is achieved when the ColumnSetGenerated event is fired...The "Type" property is bound to a valueList and displays images (Using the valueList.DisplayStyle = ValueListDisplayStyle.Picture; code).The Check property is shown as a checkbox and is set to AllowCellEdit.Full.
The question that I have is...
Is it possible to have the checkbox show for some levels in the tree hierarchy but not in others?
Ys it is possible. My tree does this in fact in OutLook mode, so I assume it is possible in other modes. What you need todo is not configure the column, but configure the cell instead.
In my case I do this:
private UltraCheckEditor ultraCheckEditor = new UltraCheckEditor();
//
// Setup required override editor
node.Cells["Override Required"].EditorControl = ultraCheckEditor;
I'm not sure why tribbles (above) is setting AllowEdit. But basically, what you would have to do is set the Editor or EditorControl on each cell. So you could set some of them to an UltraCheckEditor and some to someething else. Regarding the something else, if you just want the cell to appear blank, I recommend using an UltraPictureBox as the editor, since it will be blank with no image and it does not allow editing. So it will give you a nice clean blank cell.
Note that you do not have to create a new control for each cell. You can create one UltraCheckEditor and one UltraPictureBox and then just assign the same one to as many cells as you need.