Reputation:
ListView's OnSelectItem event fires twice. ListView is virtual in VsReport mode. How to prevent this behavior or is there a better workaround?
Upvotes: 1
Views: 1231
Reputation: 27384
The event is firing for selection and unselection. If node X was selected and you select node Y it will report:
You can make the behavior visible by :
procedure TForm5.ListView1SelectItem(Sender: TObject; Item: TListItem; Selected: Boolean); begin Showmessage(Item.Caption +' - '+IntToStr(Integer(Selected))); end;
If you want to react only on selection just evaluate Selected
.
Upvotes: 6