views:

125

answers:

1

I have set a picker's model to a custom class which inherits UIPickerViewModel

I can get the picker to display the first component's data (there are 2) but I don't see a way to tell the picker what the values are for the second column?

I'm using MontoTouch.net , but Obj-C answers are fine.

   override GetRowsInComponent (UIPickerView pickerView, int component)

This doesn't let me specify the data for the 2nd column like I could when using a datasource and delegate.

+1  A: 

You need to override the GetComponentCount method and return 2 in that case. You want something like:

public override int GetComponentCount (UIPickerView pickerView)
{
     return 2;
}

public override int GetRowsInComponent (UIPickerView pickerView, int component)
{
     // component will be 0 or 1:
     return values [component].Length;
}
miguel.de.icaza