[C#]
dataForm.SourceProvider = new SourceProviderExt();
public class SourceProviderExt : SourceProvider
{
public override IList GetSource(string sourceName)
{
var list = new List<string>();
if (sourceName == "Gender")
{
list.Add("Male");
list.Add("Female");
}
return list;
}
} |
[C#]
dataForm.AutoGeneratingDataFormItem += DataForm_AutoGeneratingDataFormItem;
private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
{
if(e.DataFormItem != null && e.DataFormItem.Name == "MaritalStatus")
{
var list = new List<string>();
list.Add("Married");
list.Add("UnMarried");
(e.DataFormItem as DataFormPickerItem).ItemsSource = list;
}
} |
dataForm.AutoGeneratingDataFormItem += DataForm_AutoGeneratingDataFormItem;
if (e.DataFormItem != null && e.DataFormItem.Name == "Iteration")
{
var sprints = await App.Database.GetItemsAsync();
List<string> items = new List<string>();
foreach(var k in sprints)
{
if(k.Name != null)
{
items.Add(k.Name);
}
}
(e.DataFormItem as DataFormPickerItem).ItemsSource = items;
} |