you should be able to do something like this

                    new Section (){
                        from name in myList
                            select (Element) new RadioElement (name, "mygroup")
                    }



On Tue, Jun 4, 2013 at 8:33 PM, Paul Johnson <p...@all-the-johnsons.co.uk>wrote:

> Hi,
>
> Got an interesting one here.
>
> I have a list of strings that I want to put into a RadioGroups set of
> RadioElements.
>
> I thought that I could do something like
>
> var section = new Section()
> {
>   foreach(string s in myList)
>     new RadioElement(s, "mygroup"),
> }
>
> but that's no good (you can't use a foreach inside of the section).
>
> Next idea was to create a List<RadioElements) and create things that way.
> Only problem there is that you still can't add the list contents to the
> section.
>
> Is there a way to do this?
>
> Paul
> --
> "Space," it says, "is big. Really big. You just won't believe how vastly,
> hugely, mindbogglingly big it is. I mean, you may think it's a long way
> down the road to the chemist's, but that's just peanuts to space, listen..."
> Hitch Hikers Guide to the Galaxy, a truly remarkable book!
>
> ______________________________**_________________
> MonoTouch mailing list
> MonoTouch@lists.ximian.com
> http://lists.ximian.com/**mailman/listinfo/monotouch<http://lists.ximian.com/mailman/listinfo/monotouch>
>
_______________________________________________
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to