Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to create a TreeView listbox with fields Region, Country and City. My TreeView allows me to select the value at the lowest level (City in my case), but I am not able to select values in Country and Region.
How can I make it work when I select Country and Region as well? The reference app is attached herewith.
Regards,
Bhaskar
You cannot use TreeView this way. The tree view is made to show hierarchies where each node has a record of its own in the source data. E.g.: "EU", "Canada" and "NA" should all have their own records. In your case, only the lowest level in the hierarchy has their own records.
One way to load your table so that this demand is fulfilled, is the following:
Load City as NodeID, Region, Country, City, Region &'/'& Country &'/'& City as Path From ... ;
Concatenate Load Country as NodeID, Region, Country, Region &'/'& Country as Path From ... ;
Concatenate Load Region as NodeID, Region, Region as Path From ... ;
Another. better way, is to store the data as an adjacent nodes table, and to load it with a Hierarchy prefix.
Read more here: Hierarchies.
HIC
Have a look at this discussion too: Treeviewer problem while expanding