listView getting values back

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jonesgj

    #1

    listView getting values back

    Hi,

    First time I am using this control in lieu of a listbox, and I want to be
    able to get values and row positions back ... I seem to be able to get the
    first col value back using focusitem, but what if I want values from other
    cols??

    I also may want to find the position of the row selected. In listbox I use
    the selectindex, how would i do this in listview?

    I'm sure this is all very easy, but unlike other controls which I have used
    for many years it seems very hard to find example constructs to follow.

    Any help gratefully appreciated.


  • Robin Tucker

    #2
    Re: listView getting values back

    ListView has SelectedIndices and SelectedItems collections.

    With a listview, a ListViewItem has an "Index" property, so SelectedItems
    (0).Index gives you the index of the first selected item.

    "Jonesgj" <g@btinternet.c om> wrote in message
    news:d8n41k$fjg $2@nwrdmz03.dmz .ncs.ea.ibs-infra.bt.com...[color=blue]
    > Hi,
    >
    > First time I am using this control in lieu of a listbox, and I want to be
    > able to get values and row positions back ... I seem to be able to get the
    > first col value back using focusitem, but what if I want values from other
    > cols??
    >
    > I also may want to find the position of the row selected. In listbox I use
    > the selectindex, how would i do this in listview?
    >
    > I'm sure this is all very easy, but unlike other controls which I have
    > used for many years it seems very hard to find example constructs to
    > follow.
    >
    > Any help gratefully appreciated.
    >
    >[/color]


    Comment

    Working...