private void LoadPickerViewInSectionTextField() { // Check Active Sections have values if (ActiveSectionsList.Count == 0) { SectionEventTextField.Enabled = false; SectionEventTextField.BackgroundColor = UIColor.FromRGB(220, 220, 220); return; } // Build data from list of EventsType List <string> data = new List <string>(); for (int i = 0; i < ActiveSectionsList.Count; i++) { Section sectionObj = ActiveSectionsList[i]; data.Add(string.Format("{0} - Nivel: {1}", sectionObj.Nombre, sectionObj.Nivel)); } // Load Picker for TypeTextField UIPickerView picker = new UIPickerView(); PickerTextFieldDataSource modelPicker = new PickerTextFieldDataSource(data, SectionEventTextField); modelPicker.Delegate = this; picker.Model = modelPicker; SectionEventTextField.InputView = picker; }
private void LoadPickerViewInEventTypeTextField() { // Check Event Types have values if (EventTypesList == null) { return; } // Build data from list of EventsType List <string> data = new List <string>(); for (int i = 0; i < EventTypesList.Count; i++) { data.Add(EventTypesList[i].Nombre); } // Load Picker for TypeTextField UIPickerView picker = new UIPickerView(); PickerTextFieldDataSource modelPicker = new PickerTextFieldDataSource(data, TypeTextField); modelPicker.Delegate = this; picker.Model = modelPicker; TypeTextField.InputView = picker; }