Board index » delphi » listview subitem edit?

listview subitem edit?

I need to edit the subitems of a listview in place during report style - can
it be done?

E.A. Gelat
ge...@NO-SPAMgelat.com
remove NO-SPAM
http://www.gelat.com/fpssite/index.html

 

Re:listview subitem edit?


I think it's like this

Listview1.Items[0].SubItems[0] := 'Joe Bloggs';

to edit the 2nd field

eg.

Supervisor  |   Joe Blogs | 9 here st

  items[0]  .    Subitems[0]  SubItems[1]

Quote
E.A. Gelat wrote in message ...
>I need to edit the subitems of a listview in place during report style -
can
>it be done?

>E.A. Gelat
>ge...@NO-SPAMgelat.com
>remove NO-SPAM
>http://www.gelat.com/fpssite/index.html

Re:listview subitem edit?


I can do that in code, but I need the user to be abdle to edit it, like he
can edit the main item from within the listview, via an editbox

Quote
Loki <raw...@ihug.co.nz> wrote in message

news:7br0c3$2qh$1@newsource.ihug.co.nz...
Quote
>I think it's like this

>Listview1.Items[0].SubItems[0] := 'Joe Bloggs';

>to edit the 2nd field

>eg.

>Supervisor  |   Joe Blogs | 9 here st

>  items[0]  .    Subitems[0]  SubItems[1]

>E.A. Gelat wrote in message ...
>>I need to edit the subitems of a listview in place during report style -
>can
>>it be done?

>>E.A. Gelat
>>ge...@NO-SPAMgelat.com
>>remove NO-SPAM
>>http://www.gelat.com/fpssite/index.html

Re:listview subitem edit?


At this point, wouldn't a string-grid be better?

What you COULD do (and this seems like a bit of work):

Figure out the left/top position of the subitem your working with, create
a TEdit control on top of the listview with no borders, sized to the size
of the subitem width, and handle the keystrokes, looking for
tab/enter/ESC so you can get the value, destroy the control, and update
the item.

HTH
-John

In article <2vbE2.34095$F63.86...@newscene.newscene.com>, gelat@NO-
SPAMgelat.com says...

Quote
> I can do that in code, but I need the user to be abdle to edit it, like he
> can edit the main item from within the listview, via an editbox

> Loki <raw...@ihug.co.nz> wrote in message
> news:7br0c3$2qh$1@newsource.ihug.co.nz...
> >I think it's like this

> >Listview1.Items[0].SubItems[0] := 'Joe Bloggs';
> >to edit the 2nd field
> >eg.

> >Supervisor  |   Joe Blogs | 9 here st
> >  items[0]  .    Subitems[0]  SubItems[1]

Other Threads