You can have as many nodes with 'null' keys as you like, but once you start setting keys, they must all be unique.
I had the same issue in a project I am working on. With mine, the treeview was populated by a dataset. The root node (level 0) and child (Level 1)would always be unique, however it was possible for a level 2 node to be trying to set the same key as a level 2 node under a different level 1 parent. I could not leave the keys as null as the key values formed the Primary Keys in the Database, so I always needed them.
What I ended up doing was concantenating value I wanted to use for the level 2 key with the key of its parent (I used a pipe '|' as a delimiter). That way I could guarantee each node key was unique for my purposes. Then if you need to, you can always extract the required key value back again by extracting everything before or after your pipe, depending on what you need to extract.
I hope this helps give you an idea suitable for what you need.
CheersJason
Jason,
thanks for your reply. You are working late or very early? Or not in Perth at the moment? Just coming back from Northbridge or so? Is it still hot there down under? And good beach conditions at Cottesloe?
I think this a bit awkward in my situation, a lot of work to do concatenation etcetera, but yes, this could possibly work. I'll see,
best regards,
Erik