Board index » delphi » Problems or bug with ListView

Problems or bug with ListView

G'day All,

I'm using the Standard ListView in Report Mode with OwnerDate := True; (aka
Virtual Mode) and I keep getting AVs when tryin to use the OnSelectItem
event.

as an example

procedure TForm.LVSelectItem(Sender: TObject; Item: TListItem;
  Selected: Boolean);
begin
  Label2.Caption := IntToStr(Item.Index);
end;

this routine works first time it is called but I get AVs on every SelectItem
after that...

Can anyone shed any light on what is wrong or is this just another bug with
the ListView.

thanks

Graham

btw: the routine will actually return the correct results after it has
finished AVing.

 

Re:Problems or bug with ListView


I have used virtual mode extensively and do not receive any AVs.
Have you set the count correctly ?

Quote
"Graham Pyne" <grahamp...@no.hotmail.spam.com> wrote in message

news:3bbd5506_2@dnews...
Quote
> G'day All,

> I'm using the Standard ListView in Report Mode with OwnerDate := True;
(aka
> Virtual Mode) and I keep getting AVs when tryin to use the OnSelectItem
> event.

> as an example

> procedure TForm.LVSelectItem(Sender: TObject; Item: TListItem;
>   Selected: Boolean);
> begin
>   Label2.Caption := IntToStr(Item.Index);
> end;

> this routine works first time it is called but I get AVs on every
SelectItem
> after that...

> Can anyone shed any light on what is wrong or is this just another bug
with
> the ListView.

> thanks

> Graham

> btw: the routine will actually return the correct results after it has
> finished AVing.

Re:Problems or bug with ListView


Quote
> "Graham Pyne" <grahamp...@no.hotmail.spam.com> wrote in message
> news:3bbd5506_2@dnews...
> > G'day All,

> > I'm using the Standard ListView in Report Mode with OwnerDate := True;
> (aka
> > Virtual Mode) and I keep getting AVs when tryin to use the OnSelectItem
> > event.

"Robert Lancaster" <robert.lancas...@thales-geosolutions.com> wrote in
message news:3bc170c8_2@dnews...

Quote
> I have used virtual mode extensively and do not receive any AVs.
> Have you set the count correctly ?

Yes, I have.

I'm not having any problems populating the ListView. It's on selecting an
item afterwards that I'm having trouble.

I have managed to bypass the problem using LV.ItemFocused.Index in the
OnClick event but that still doesn't explain why I was getting AVs
originally. Ahh well.

thanks

Graham

Other Threads