Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Enumerate a SortedList
Message
From
01/02/2009 04:34:33
 
 
To
31/01/2009 15:42:52
John Baird
Coatesville, Pennsylvania, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01378599
Message ID:
01378650
Views:
12
>>>>
>>>>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......
Previous
Reply
Map
View

Click here to load this message in the networking platform