View Issue Details

IDProjectCategoryView StatusLast Update
0004393JEDI VCL00 JVCL Componentspublic2008-12-30 03:22
ReportertetarddAssigned Toobones 
Status resolvedResolutionfixed 
Product Version3.32 
Target VersionFixed in Version3.36 
Summary0004393: Setting the Selected property of TJvTreeView does not trigger the OnSelectionChange event
DescriptionIf you set in code the Selected property to select a tree node, the OnSelectionChange event is not triggered.
Looking at the code, it seems that DoSelectionChange in not called in procedure CNNotify() in the TVN_SELCHANGEDA, TVN_SELCHANGEDW block of code.
TagsNo tags attached.



2008-07-15 00:55

administrator   ~0014374

Please use the very latest version of the JVCL
Then, if the bug is still there, please provide the zipped sources of a sample application showing this.


2008-07-17 02:08

reporter   ~0014395


I checked the code for version 3.33 and 3.32 of TJvTreeView and there is no chnages in the code so the bug has not been fixed.
I fixed it myself by modification on the code below:

Procedure TJvTreeView.CNNotify(var Msg: TWMNotify);
          DoSelectionChange; // <- Corrects the OnSelectionChanged bug.
          if Assigned(FPageControl) then
               if Selected <> nil then

I also include a zip file of the application demonstrating the bug (and incidentally also the one in issue 004403):

Run the app (Project5.exe).
1- Select one tree view
2- Click the 'Change Selection in Code' button.

As expected, the label showing the selected item is correct and the memo that displayed triggered event is OK too.
Note that the selected item hasn't got its background drawn even if HideSelection is False (issue 004403).

3- Click again the 'Change Selection in Code' button.

No OnSelectionChange event has been triggered (as shown by memo lines).

4- Click the 'Add item and seelct it'.

A new item is added and selected and once again, no OnSelectionChanged is triggered.

I include an exe with my own fix (Project5 - Fixed.exe). Now, the events are properly triggered but some are done several times in a row so it is not a brilliant fixc.


2008-07-17 02:11

reporter   ~0014396

Having problems uploading demo of bug.


2008-07-17 02:34

administrator   ~0014397

Don't include the exe, we only want sources. With the exe, the zip file is too big anyway


2008-10-10 05:17

administrator   ~0014826

Hello, any news?

2008-11-05 13:25


TJvTreeView Bug (8,230 bytes)


2008-12-30 03:22

administrator   ~0015198

This is now in SVN

Issue History

Date Modified Username Field Change
2008-07-04 13:44 tetardd New Issue
2008-07-15 00:55 obones Note Added: 0014374
2008-07-15 00:55 obones Status new => feedback
2008-07-17 02:08 tetardd Note Added: 0014395
2008-07-17 02:11 tetardd Note Added: 0014396
2008-07-17 02:34 obones Note Added: 0014397
2008-10-10 05:17 obones Note Added: 0014826
2008-11-05 13:25 tetardd File Added: TJvTreeView Bug
2008-12-30 03:22 obones Note Added: 0015198
2008-12-30 03:22 obones Status feedback => resolved
2008-12-30 03:22 obones Fixed in Version => Daily / SVN
2008-12-30 03:22 obones Resolution open => fixed
2008-12-30 03:22 obones Assigned To => obones