0

Basically I want the same functionality that you get by using the RadioSelection attribute except that it allows multiple selections to be made.

Something like this:

[CheckSelection]
private IList<int> currentSelections;
private IList<string> myList;

Looking at the documentation there doesn't seem to be a mention of anything like this. So my question is: Can a Checkbox Selection list be created with the present version of MonoTouch.Dialog? If so, then how? If not, is there a better way to handle this case?

Adam Jones
  • 2,370
  • 5
  • 23
  • 40

2 Answers2

1

This is the approach I used to achieve this:

var root new RootElement() { 
    new Section("Bacon"){ 
        new RootElement ("Types", new  RadioGroup (0)){ 
            new Section(){  
                new CheckboxElement ("Smokey"),  
                new CheckboxElement ("Streaky"), 
                new CheckboxElement ("Rasher")
            }   
        }
    } 
};

Taken from

http://monotouch.2284126.n4.nabble.com/MT-Dialog-multi-select-element-td4516738.html

Colin Bacon
  • 15,436
  • 7
  • 52
  • 72
1

You'll have to extend MT.Dialog to do this.

Jason
  • 86,222
  • 15
  • 131
  • 146
  • Ok, that's what I thought. Some parts in the source made it seem like this might already be possible so I just wanted to check before I went any further. Thanks. – Adam Jones Sep 20 '11 at 23:41