Jump to content
RichardAD

Trouble making synchronized virtual ListViews

Recommended Posts

Any help would be greatly appreciated.

 

I"ve been trying (for too long) to get two virtual ListViews (report mode) with the same back store to have synchronized selections.  I either get stack overflows, or invalid address, or infinite looping.  I also want to be able to select the same index in both ListViews for a given input but the cross selected cross wiring is not helping.

 

I thought it would be some simple flags, but it's turning out to be a nightmare.  To simplify things, the sample uses a random number for the back store.
image.thumb.png.16679eae6531ff6a226cba1a9a20939a.png
 

main.pas

main.dfm

Share this post


Link to post

There are two things missing:

  1. To make the selection of the other view visible, the HideSelection of the listview has to be false.
  2. OnSelectItem is also triggered when an item is unselected. You should call Clear for the numberbox and ClearSelection for the listview then.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×