ChangeMapKey()
Posted: Mon Apr 08, 2013 11:08 am
Hi,
I have a treegadget generated from a database the fields of the database are stored in a map with the id of the
record as key. This id is also stored as ItemData().
If I 'add' a new member in the tree I generate a new ID with a very large number.
Later if the user decided to save his new tree I update the database or I insert a new record.
But the new record gets an automatic ID by the database.
I have to change the ItemData (no problem) and I have to change the MapKey() (not possible)
So I have to copy the MapElement (CopyMapElemnt() not available) and I have to delete the old one.
It would be much easier if ChangeMapKey() is available.
Btw. I changed now everything to a LinkedList() and store the address of the element as ItemData()
Than I can use ChangeCurrentElement()
That's independent from the ID of the record.
Bernd
I have a treegadget generated from a database the fields of the database are stored in a map with the id of the
record as key. This id is also stored as ItemData().
If I 'add' a new member in the tree I generate a new ID with a very large number.
Later if the user decided to save his new tree I update the database or I insert a new record.
But the new record gets an automatic ID by the database.
I have to change the ItemData (no problem) and I have to change the MapKey() (not possible)
So I have to copy the MapElement (CopyMapElemnt() not available) and I have to delete the old one.
It would be much easier if ChangeMapKey() is available.
Btw. I changed now everything to a LinkedList() and store the address of the element as ItemData()
Than I can use ChangeCurrentElement()
That's independent from the ID of the record.
Bernd