Hi,
I have a ListView with Custom Cell in it.
The custom Cell looks like this:
`
public class CustomCell : ViewCell
{
private readonly string[] _pickerFields = new string[] {"1", "2", "3"};
public CustomCell()
{
var label1 = new Label
{
Text = "",
};
label1.SetBinding(Label.TextProperty, new Binding("."));
var Picker = new BindablePicker()
{
Title = "status",
HorizontalOptions = LayoutOptions.StartAndExpand,
ItemsSource = _pickerFields,
SelectedIndex = 0
};
View = new StackLayout
{
Orientation = StackOrientation.Horizontal,
HorizontalOptions = LayoutOptions.StartAndExpand,
Children =
{
label1,
Picker,
label2,
}
};
}
}
`
Then I call my ListView like this. and for some reason label1 is filled with the "service.TextForList" .
listView.ItemsSource = List.Select(service => service.TextForList);
listView.ItemTemplate= new DataTemplate(typeof(CustomCells.CustomCell));
But how do I set the selected Index for the Picker and the Text for label2?
Thank you