Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Enumerate a SortedList
Message
De
01/02/2009 04:34:33
 
 
À
31/01/2009 15:42:52
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01378599
Message ID:
01378650
Vues:
18
>>>>
>>>>Off the top of my head, you probably could use:
>>>>
>>>>for(Control sometype ...
>>>>
>>>>or
>>>>
>>>>for(Object sometype...
>>>>
>>>>
>>>>
>>>>John
>
>
>That's what I said,

Not quite. You're suggestion was to enumerate the KeyValuePairs and extract the value. Essentially:
            foreach (KeyValuePair<string, Control> kvp in DataControls)
            {
                string s = kvp.Value.GetType().Name;
            }
I suggested using the SortedList.Values collection directly......
Both would work - mine was shorter :-}

> but I guess I didn't understand the question based on Bob's reply.

I, like you, thought the requirement was simply to determine the type of each control in the list......
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform