Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ListView Items Not Showing
Message
De
08/08/2010 01:23:48
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01475624
Message ID:
01475633
Vues:
41
Your code looks ok Kevin ... are you sure you have data in those rows? Have you stepped through this code in the debugger? If so, check the lstTribals.Items.Count after you add a new item.

~~Bonnie


>I have a ListView on my form. It's View property is set to Details. I'm loading from a dataset:
>
>
>foreach (DataRow Row in dsTribals.Tables[0].Rows)
>{
>    if (Row["Price"] != DBNull.Value)
>    {
>        PartPrice = (decimal)Row["Price"];
>    }
>    ListViewItem NewItem = new ListViewItem(Row["TribalNumber"].ToString());
>    NewItem.SubItems.Add(PartPrice.ToString());
>
>    lstTribals.Items.Add(NewItem);
>}
>
>The code runs, but I see nothing in the list.
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