So far I've tried:
ItemIndex := 0;
onClick.Sender;
ItemFocused := Items[0];
as well as the combination of:
Selected := Items[0];
Selected.MakeVisible(False);
Any one of those lines will trigger the "onSelectItem" method,
but none of them will highlight the row for me.
Rick Carter
Rick....@cincww.rcc.org
Chair, Paradox/Delphi SIG, Cincinnati PC Users Group
I think the listview maybe not have focus and
that the listview's HideSelection property is
maybe set true.
-
Grant
Try:
MyListView.Items[0].Selected := True;
Also, does your ListView have the focus?
--
Alvin Lee
"The new approach is still about people; it's just that before we
were for them and now we're against them." --Harvard Business Review
> Typo! Actually, what I tried was:
> onClick(Sender);
Whoah!
I think others in this thread will have solved your problem for you -
assigning to Selected DOES work.
A small note though - I've found it to be bad practice to directly call
events directly. If you can't work out why for yourself, start a new
thread and see what people say. ;-)
Cheers,
Bevan.
Exactly right! Either setting the ListView's HideSelection
property to False, or first calling
Active Control := ListView1;
did the job.
Thanks, this had me stumped for a while!