Hello guys,
@Derek : you're right, I've been on and off for a few month because work was quite heavy lately, but I always keep an eye on the forum and on old friends
Three things I wanted to add :
First, 'keywords.TableGrid1.dbItemID := lid;' refers to a database ID, so should not be "broken" by any sorting. The tablegrid I tested it on was sorted and it still worked.
But then, this 'Last_Insert_id' thing only works on a database INSERT. If you try this method on an UPDATE, it won't give you the last modified ID, but the last inserted one, which could have been added hours ago...
If you want to select the row after an UPDATE, you'll have to identify the database ID with another method first.
Second, you can not set the focus on multiple objects on a form. So if you want to highlight lines in different grid, don't use the 'setfocus' command.
I personally setup my grids with a 'selectfullrow' option and this is enough to highlight the row I want.
More on that after Christmas if needed.
Last but not least, I see a lot of attempt at Treeviews, so I thought I might post my implementation of it here :
My application is an asset manager, assets to which you can attach keywords to identify them. They also have a link to the online shop you can find them and a status flag (owned, wanted, download in progress...).
The following treeview represents the assets grouped by Keywords, and the vendors with icons for each levels and a special icon to show their status.
You will see :
first level : keywords (this is test data)
second level : vendors
third level : assets
Each level has it's own icon, and some assets (third level) have a little green tick, showing they are owned. And each level also has a counter showing how many items it contains.
I've stripped down all the rest of the code, all other forms and all irrelevant data from the database because the package was over 300Mo wether now, it's a little under 1,5 Mo.
Hope this helps
Have yourself a Merry Christmas as used to sing Franck Sinatra.
Cheers
Mathias
I'm a very good housekeeper !
Each time I get a divorce, I keep the house
Zaza Gabor