0

Our treelist lookup displays a three-tiered hierarchy. The first two tiers, as shown by the indentation level, are merely navigational/organizational (categories) and are not valid EditValue choices. They should simply expand as nodes.

For example:

Clothing
   Mens
       Shoes
       Shirts
       Trousers
   Womens

Toys
   Baby
       Rattle
       Bird Mobile 
  Toddlers
       Push Cart

The node's keyValue is valid as an EditValue only if the node does not have children.

Is it possible to set as "unselectable" all nodes in the first tier (Clothing, Toys, etc) and all nodes in the second tier (Mens, Womens, Baby,Toddlers, etc) while still giving these nodes the ability to expand/collapse in response to clicks?

I would like to make it impossible for the user to choose those nodes, rather than display an error after the control loses focus.

At the moment, my code is examining the FocusedNode in the QueryCloseUp event, and preventing the close-up if the node has children. But that approach has a major drawback: the user cannot close the dropdown without making a valid choice.

This must be a common requirement for the TreeListLookUpEdit. What is the standard way of handling this situation?

Tim
  • 8,669
  • 31
  • 105
  • 183

1 Answers1

0

I found a simple way:

Cancel = True in the EditValueChanging event if the focused node has children.

Tim
  • 8,669
  • 31
  • 105
  • 183