Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
215
Checkbox issue?
posted

I've got a custom list that I'm binding to the tree, which works fine.  I don't want checkboxes throughout every level of the tree, I just want checkboxes on the nodes at the LAST level (last descendant).

 At the moment, I'm able to handle the InitializeDataNode event, and see the nodes being initialized.  When a node's ListObject happens to be of a specific type (my custom type), I set the Override property of that node, like this:

private void ultraTree1_InitializeDataNode(object sender, Infragistics.Win.UltraWinTree.InitializeDataNodeEventArgs e)
        {
            if (e.Node.ListObject is MyObject)
            {               
                e.Node.Override = _over; 
            }
        }

The _over object is just a class-level Override, which looks like this:

_over = new Override();

_over.NodeStyle = NodeStyle.CheckBox;

 

PROBLEM IS....  even though I can see the Override property being set, the checkbox never shows up in my tree.  Any ideas?

Thanks guys!

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi,

    If you are binding the tree to a data source, then the tree is probably displaying in a grid style with columns. The CheckBox setting you are using here only applies to standard nodes, it does not apply to nodes that are in a grid style. 

    If you want a checkbox in a grid-style node, you will need to put the checkbox into a column. So what you probably need to do here is an an unbound column to the ColumnSet that is being used by your lowest-level nodes. 

    So, assuming you are not creating the column sets yourself and that you are just letting the tree generate them automatically, then what you should do is handle the ColumnSetGenerated event and check the Key of the ColumnSet to find the right one for the band of data at the lowest level. The you can add a column to that ColumnSet and set it's DataType to boolean to make it a checkbox. 

Reply Children