Ian Vink
Ian Vink

Reputation: 68830

MonoTouch.Dialog: No Default value

I am using the BindingContext to generate the table and don't want a default value chosen.

My Class has this field:

[RadioSelection ("Model:")] 
public int model = -1;
public IList<string> Model; 

It is then added to the Root:

car = new AddCar () {
    Model = new List<string>(){"ES 250","ES 300","ES 330","ES 350"}
};
bc = new BindingContext (this, car, "Add Your Vehicle");
this.Root = bc.Root;

However the UI renders a selected value "ES 250" instead of a blank value:

enter image description here

Upvotes: 0

Views: 154

Answers (1)

Jason
Jason

Reputation: 89204

Add a null or empty value to the beginning of your list. Otherwise your only option is to modify MT.Dialog to behave the way you want.

Upvotes: 2

Related Questions