Thanks for the suggestions.

I like the idea of casting the Integer as an Object and then casting it back
again as it seems to have wider applicability (ie to all the other list
thingies).

Thanks again. 

-----Original Message-----
From: Cheng Wei [mailto:[EMAIL PROTECTED]]
Sent: 2 May 2001 09:23
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Listview Question: where is itemdata.


Some other alternatives are:

1. SomeListItem.Data := TObject(MyIntegerID) where MyIntegerID is the key
value of your database record, you can then do Integer(SomeListItem.Data) to
retrieve it back.

2. SomeListItem.SubItems.Add(IntToStr(MyIntegerID)) and make this column
invisible, then you can StrToInt() it back, this way you can store many
extra columns of info onto the TListView (just not showing them).

Regards
Cheng

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Alan Rose
Sent: Wednesday, 2 May 2001 08:57
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Listview Question: where is itemdata.


If am using the listview in report mode and I am not assigning icons to the
records then I sometimes use the imageindex or stateindex property to hold
my database key record value (both properties of type integer)

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of James Low
Sent: Wednesday, May 02, 2001 8:56 AM
To: Multiple recipients of list delphi
Subject: [DUG]: Listview Question: where is itemdata.


In vb a Listview object has an Itemdata property which can be used to store
the key value of the listitem which has been read from a database. This
seems to be used in Delphi to hold a pointer to the Listobject. Is there a
really simple way to assign an integer to the itemdata property - so I can
basically have the same functionality as the vb Listbox (ie store the Text
and the ID for the List Item)? Or am I using the wrong component (cannot use
DBLookupList b/c the user needs to select multiple rows).

Seems simple enough - but before wading through how Itemdata property is
used in the VCL I thought I would ask.

Thanks

James Low

-----Original Message-----
From: Jeremy Coulter [mailto:[EMAIL PROTECTED]]
Sent: 2 May 2001 08:24
To: Multiple recipients of list delphi
Subject: [DUG]: ownerdraw on Listviews


HI All.

I am ownerdrawing a listview, BUT because of this, I need to draw the focus
on the selected item, i.e. the selected back ground etc.
Can anyone tell me how to go about it?
I mean , I now HOW to do it, but rather I need to know WHERE to initiate it
etc.


Thanks, Jeremy Coulter

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to