Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to Edit Subitems of TListView

1,084 views
Skip to first unread message

Peter Huber

unread,
Jun 4, 1999, 3:00:00 AM6/4/99
to
Hi,

I'm looking for a possibility to edit the subitems of a TListItem in a
TListView component. It is possible to edit the caption of the TListItem

by pressing F2 or doubleclicking the item. But there seems no way to
do the same with the subitems. So I played around with a TEdit which
I placed over the subitem text on the TListView component. But there
is a lot of work to do till everything behaves correct with inputs from
mouse and keyboard and changing focuses. So I'm wondering if any-
body has a solution for this problem. Thanks for your answers.

Peter

Mark Lauter

unread,
Jun 4, 1999, 3:00:00 AM6/4/99
to
Perhaps a TTreeView would give you the same functionality you desire and it
has the ability to edit sub items (since each sub item is just another node
on the tree).

HTH

Peter Huber <hu...@eek.ee.ethz.ch> wrote in message
news:37581E9D...@eek.ee.ethz.ch...

Peter Huber

unread,
Jun 4, 1999, 3:00:00 AM6/4/99
to
It's rather the TStringGrid or TDrawGrid component which meets my
requirements because the Information I want to display is in tabular form.
But I'm not really happy with this old components because many of the
features you get with TListView and TTreeView are not availabe with
these components. Thanks for your hint, Mark.

Peter

Mark Lauter

unread,
Jun 4, 1999, 3:00:00 AM6/4/99
to
You're welcome. I liked you idea of putting a TEdit box over the TListView.
Maybe you could code that functionality into a component.

Peter Huber <hu...@eek.ee.ethz.ch> wrote in message

news:37585227...@eek.ee.ethz.ch...

Andreas Pawlik

unread,
Jun 4, 1999, 3:00:00 AM6/4/99
to
>Peter Huber wrote:
>
>I'm looking for a possibility to edit the subitems of a TListItem in a
>TListView component. It is possible to edit the caption of the >TListItem by pressing F2 or doubleclicking the item. But there seems >no way to do the same with the subitems.

As Subitems is of type TStrings, you might try something like this and
modify it to fit your needs. Put it into one of the ListView's mouse
events (which has the additional advantage of giving you two more
params, Button and Shift):

ListView.GetItemAt(x, y).Subitems.Strings[0] :=
InputBox('','','NewValue');

Will change the first subitem of the selected ListItem to the value you
enter into InputBox. Not too elegant but effective ..
_________
Andreas

Timo van Noppen

unread,
Jun 4, 1999, 3:00:00 AM6/4/99
to
You can find something about placing components on a stringgrid on Lou's
Delphi Tips. I used this and it works very nice.

http://members.truepath.com/delphi/totdindex.html

Timo

Peter Huber <hu...@eek.ee.ethz.ch> schreef in berichtnieuws


37585227...@eek.ee.ethz.ch...
> It's rather the TStringGrid or TDrawGrid component which meets my
> requirements because the Information I want to display is in tabular form.
> But I'm not really happy with this old components because many of the
> features you get with TListView and TTreeView are not availabe with
> these components. Thanks for your hint, Mark.
>
> Peter
>
> Mark Lauter wrote:
>
> > Perhaps a TTreeView would give you the same functionality you desire and
it
> > has the ability to edit sub items (since each sub item is just another
node
> > on the tree).
> >
> > HTH
> >
> > Peter Huber <hu...@eek.ee.ethz.ch> wrote in message
> > news:37581E9D...@eek.ee.ethz.ch...
> > > Hi,
> > >

> > > I'm looking for a possibility to edit the subitems of a TListItem in a
> > > TListView component. It is possible to edit the caption of the
TListItem
> > >
> > > by pressing F2 or doubleclicking the item. But there seems no way to

0 new messages