List of selected items in a listview 
Author Message
 List of selected items in a listview

Hi,

    I would like to know, how a can retrieve the selected items in a
listview control. There is a CheckedIndexCollection, but i can't access it.
Can someone help me with an examble please?

Thank you

Luc Coveney



Mon, 30 May 2005 12:27:20 GMT  
 List of selected items in a listview
Hi,

you can use the selected item property of the listview control to get the
list of selected items,

Code snippet;

   Dim i As Integer
   For i = 0 To ListView1.SelectedItems.Count - 1
        MessageBox.Show(ListView1.SelectedItems(i).Text)
   Next

Regards,
S.Annamalai.


Quote:
> Hi,

>     I would like to know, how a can retrieve the selected items in a
> listview control. There is a CheckedIndexCollection, but i can't access
it.
> Can someone help me with an examble please?

> Thank you

> Luc Coveney



Mon, 30 May 2005 12:48:38 GMT  
 List of selected items in a listview
Thank's,

    But i woul like to know the index in the list of the object too! Is it
possible?



Quote:
> Hi,

> you can use the selected item property of the listview control to get the
> list of selected items,

> Code snippet;

>    Dim i As Integer
>    For i = 0 To ListView1.SelectedItems.Count - 1
>         MessageBox.Show(ListView1.SelectedItems(i).Text)
>    Next

> Regards,
> S.Annamalai.



> > Hi,

> >     I would like to know, how a can retrieve the selected items in a
> > listview control. There is a CheckedIndexCollection, but i can't access
> it.
> > Can someone help me with an examble please?

> > Thank you

> > Luc Coveney



Mon, 30 May 2005 12:58:05 GMT  
 List of selected items in a listview
Hi,

you can use Index property of the selected item to get the index of the
item.  The index is zero based.

Code Snippet;

ListView1.SelectedItems(i).Index

Regards,
S.Annamalai.

Quote:
> Thank's,

>     But i woul like to know the index in the list of the object too! Is it
> possible?



> > Hi,

> > you can use the selected item property of the listview control to get
the
> > list of selected items,

> > Code snippet;

> >    Dim i As Integer
> >    For i = 0 To ListView1.SelectedItems.Count - 1
> >         MessageBox.Show(ListView1.SelectedItems(i).Text)
> >    Next

> > Regards,
> > S.Annamalai.



> > > Hi,

> > >     I would like to know, how a can retrieve the selected items in a
> > > listview control. There is a CheckedIndexCollection, but i can't
access
> > it.
> > > Can someone help me with an examble please?

> > > Thank you

> > > Luc Coveney



Mon, 30 May 2005 14:05:45 GMT  
 List of selected items in a listview
Hello again,

    I try this, but the system return "Specified argument was out of the
range of valid values.". I don't understand, because i select 3 objets and
listview1.checkeditems.count = 3???

    Can you help me more please?

Thank's

Luc



Quote:
> Hi,

> you can use Index property of the selected item to get the index of the
> item.  The index is zero based.

> Code Snippet;

> ListView1.SelectedItems(i).Index

> Regards,
> S.Annamalai.


> > Thank's,

> >     But i woul like to know the index in the list of the object too! Is
it
> > possible?



> > > Hi,

> > > you can use the selected item property of the listview control to get
> the
> > > list of selected items,

> > > Code snippet;

> > >    Dim i As Integer
> > >    For i = 0 To ListView1.SelectedItems.Count - 1
> > >         MessageBox.Show(ListView1.SelectedItems(i).Text)
> > >    Next

> > > Regards,
> > > S.Annamalai.



> > > > Hi,

> > > >     I would like to know, how a can retrieve the selected items in a
> > > > listview control. There is a CheckedIndexCollection, but i can't
> access
> > > it.
> > > > Can someone help me with an examble please?

> > > > Thank you

> > > > Luc Coveney



Fri, 03 Jun 2005 01:17:35 GMT  
 List of selected items in a listview
Hi,
       Can you just elborate your problem? Are you trying to find out total
list of items in the control or just the selected items list or the index of
the selected item.

Regards,
S.Annamalai.


Quote:
> Hello again,

>     I try this, but the system return "Specified argument was out of the
> range of valid values.". I don't understand, because i select 3 objets and
> listview1.checkeditems.count = 3???

>     Can you help me more please?

> Thank's

> Luc



> > Hi,

> > you can use Index property of the selected item to get the index of the
> > item.  The index is zero based.

> > Code Snippet;

> > ListView1.SelectedItems(i).Index

> > Regards,
> > S.Annamalai.


> > > Thank's,

> > >     But i woul like to know the index in the list of the object too!
Is
> it
> > > possible?



> > > > Hi,

> > > > you can use the selected item property of the listview control to
get
> > the
> > > > list of selected items,

> > > > Code snippet;

> > > >    Dim i As Integer
> > > >    For i = 0 To ListView1.SelectedItems.Count - 1
> > > >         MessageBox.Show(ListView1.SelectedItems(i).Text)
> > > >    Next

> > > > Regards,
> > > > S.Annamalai.



> > > > > Hi,

> > > > >     I would like to know, how a can retrieve the selected items in
a
> > > > > listview control. There is a CheckedIndexCollection, but i can't
> > access
> > > > it.
> > > > > Can someone help me with an examble please?

> > > > > Thank you

> > > > > Luc Coveney



Fri, 03 Jun 2005 13:41:39 GMT  
 List of selected items in a listview
Hello,

    OK. It's fine, i found the answer.

Thank you for your time.

Luc



Quote:
> Hi,
>        Can you just elborate your problem? Are you trying to find out
total
> list of items in the control or just the selected items list or the index
of
> the selected item.

> Regards,
> S.Annamalai.



> > Hello again,

> >     I try this, but the system return "Specified argument was out of the
> > range of valid values.". I don't understand, because i select 3 objets
and
> > listview1.checkeditems.count = 3???

> >     Can you help me more please?

> > Thank's

> > Luc



> > > Hi,

> > > you can use Index property of the selected item to get the index of
the
> > > item.  The index is zero based.

> > > Code Snippet;

> > > ListView1.SelectedItems(i).Index

> > > Regards,
> > > S.Annamalai.


> > > > Thank's,

> > > >     But i woul like to know the index in the list of the object too!
> Is
> > it
> > > > possible?



> > > > > Hi,

> > > > > you can use the selected item property of the listview control to
> get
> > > the
> > > > > list of selected items,

> > > > > Code snippet;

> > > > >    Dim i As Integer
> > > > >    For i = 0 To ListView1.SelectedItems.Count - 1
> > > > >         MessageBox.Show(ListView1.SelectedItems(i).Text)
> > > > >    Next

> > > > > Regards,
> > > > > S.Annamalai.



> > > > > > Hi,

> > > > > >     I would like to know, how a can retrieve the selected items
in
> a
> > > > > > listview control. There is a CheckedIndexCollection, but i can't
> > > access
> > > > > it.
> > > > > > Can someone help me with an examble please?

> > > > > > Thank you

> > > > > > Luc Coveney



Fri, 03 Jun 2005 16:56:07 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. List of selected items in a listview

2. ListView Control - Removing selected items from the list

3. ListView: Selecting first item in list

4. How to Make Selected item in ListView top of list

5. jump listview to the hilight item (selected item)...

6. Why does the previous selected item in a ListView get selected for a short moment

7. ListView control - Keeping selected items looking selected

8. Selecting items in a DB-list and passing fields from selected rec to a control

9. selecting items in a Data bound list and passing a field content for the selected record

10. Selecting Items in a SELECT List

11. ListView - How to programatically select an item

12. Select automatically an item in a ListView

 

 
Powered by phpBB® Forum Software