Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieve values from a ListView
Message
De
01/09/2005 12:24:54
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01045471
Message ID:
01045890
Vues:
25
Oooops, sorry Pete ... I meant to use the Text property of the SubItems. My bad. =(

And yes, you can use the sender parameter. You just cast it to a ListView. So, something like this:
ListView oList = (ListView)sender;
ListViewItem item = oList.SelectedItems[0];
int paydetailsid = (int)item.SubItems[10].Text;
int payaddressid = (int)item.SubItems[11].Text;
~~Bonnie


>Hello Bonnie, just thought I'd bring you up to date with lv saga, I tried the code you suggested but received an error ( not verbatim ) stating "Cannot cast Listview.Subitem to type int", I then tried this code which works
>
>
>    ListViewItem item = this.lvClaims.SelectedItems[0];
>    int paydetailsid = Convert.ToInt32(item.SubItems[10].Text);
>    int payaddressid = Convert.ToInt32(item.SubItems[11].Text);
>
>
>thanks for putting me on the right track, is there a way of casting the sender parameter to retrieve the same info ?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform