Topic: For Derek

Hello Derek, how are you with that goddamn covid ?

I use your scripts which you put on the forum to classify in alphabetical order the items of a Treeview. They work very well (thank you) put after a few seizures, it gets carried away.

At the beginning I tested one of the styles of version 6.5 and I held it responsible, especially as the styles displayed an error message to me
(suddenly I removed the style and it goes better)

Sorting is no longer done and new items are added without sorting systematically at the end of the list.

Stranger still, while a tablegrid is associated with the Treeview, when I delete a row from the TableGrid, the last item in the Treeview is also deleted

I reread both scripts to verify that my settings are correct. Nothing found.
Do you have an explanation because your scripts are very practical?

I thank you in advance

JB

Post's attachments

Attachment icon TEST.ZIP 347 kb, 255 downloads since 2021-03-07 

Re: For Derek

Salut Jean,
Ca va?
I had a look at your project but I don't understand how it actually works.
I can enter data in the treeview and I can enter data in the tablegrid but there doesn't seem to be any connection between the tree and the grid;  it's almost like they are independent of each other.
Do you have an example with some data in it - perhaps I'll understand it better.
Thanks,
Derek.

Re: For Derek

Hello Derek

Thanks for considering my problem.
MVD's Treeview disturbs me a lot because its behavior is different from a normal Treeview as in RAD XE3 and even in Delphi7 which I am used to and which does not pose a problem (in addition there is a sort function (data or text )) which is missing in that of MVD.

Indeed, I do not see how to associate tableGrid with Treview2. The only solution I found is to associate the grid and the treeview via this instruction (frmNotes_OnShow):
frmNotes.Treeview2: = Form1.Treeview2;
frmNotes.Treeview2.dbitemid: = form1.treeview2.dbItemID;

In fact, I have an ID match between the Treeview and when I save a new book it is added to the list of works by the same author because behind the SAVE button I add the Treeview with the other fields to save.
By default it is a last resort.

My main problem is alphabetical sorting which is not done in the treeview.
Thank you for your interest in my anomaly

Please find in attachment my project with somes datas

JB

Post's attachments

Attachment icon TESTS_DATA.ZIP 396.5 kb, 270 downloads since 2021-03-10 

Re: For Derek

Hello Derek
How are you ?

After a few difficult days, I come back with my TreeView anomaly.
In fact I can easily associate a database (via an input form) with the Treeview of the Form1.
It works flawlessly
The only link I have found is through the dbItemID of the TV and the grid.
In fact, my problem comes when I try to implement your 2 scripts to automatically sort Parents (root) and children (child).
When I use your procedure behind the Button Form1.Button4 of your MTV program (with planes), I get an error message saying: "Table sorted already exists".
I pull my hair without finding the reason for this message.
Thanks if you have an idea
This does not prevent me from continuing to create new record cards,
but it's annoying to go around in circles and stumble on a heady message
thanks in advance

JB

5 (edited by derek 2021-03-17 18:08:20)

Re: For Derek

Hi Jean,
Ca va?
I have been looking at your problem for a few days now (off and on) and I'm not quite sure why I can't get it to work (I don't often use 'treeviews' because I find they raise more issues than they resolve)!
One thing I wasn't sure about in the project you attached, was why you use 2 separate forms (Form1 and FrmNotes);  I'm not sure if you lose any functionality by doing it all on one form.  So I took an old project of mine and tried to re-work it (I will attach it when I've got it working how I want it to and maybe it will help - but possibly it will make things worse!!!).
When I was writing the routine to sort a 'treeview', I remember if the sort had failed for some reason, it would leave a 'sorted' version of the table and I would have to use something like 'sqllitestudio' to manually delete it.  I suppose what I should have done is put something in place at the start to check if a 'sorted' table already existed and, if so then drop it.
Derek.