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
I agree, you have more freedom, but it can be very frustrating not having a team of developers working together to bounce around ideas.
Thanks again for your help and good luck with the move to Madrid.
I have done the same, one developer etc.... The good thing about it is you have more freedom, the bad thing is you have to figure out everything yourself.
Good luck as well with your project. You might wunder why I know places around Perth. I lived in Perth for about 4 years in the early 90's. I consider Perth a bit as my second home town. Yes, I saw Perth is getting into the high thirties. Nice, here it is cold, rainy and windy.
Now I live in Amsterdam, but will probably move to Madrid soon (girlfriend...).
Cheers,
Working very early :) Warming up for the year...starting to get our 35+ degree days every so often so summer is definately around the corner for us.
Good luck with your piece. I know what you mean about awkward. I am working on a contract management application that must interface with a parent application and the partner who created the parent application refuses to allow us to see the source code, so I have to 'best guess' how their functions work when I need to interact with them. The one thing they let on was they they use the Infragistics assemblies for their controls instead of the built in ones...but you know...flying blind almost.
6 months into development...another year to go...only 1 developer...you got to love small companies :)
Best of luck Erik.