One more issue, when I using Combobox.Text = "sometext", it not show too
Here my code:
public class SFCombobox : ContentPage
{
SfComboBox combo;
Button btn;
EmployeeViewModel model;
List<string> list;
public SFCombobox() : base()
{
combo = new SfComboBox();
btn = new Button();
model = new EmployeeViewModel();
InitList();
combo.BindingContext = model;
combo.Text = "DDDDD";
//combo.SelectedValue = "DDDDD";
combo.ComboBoxSource = list;
btn.Text = "Toogle";
btn.Clicked += Btn_Clicked;
//combo.SelectedValuePath = "ID";
//combo.DisplayMemberPath = "Name";
//combo.SetBinding(SfComboBox.DataSourceProperty, "EmployeeCollection");
this.Content = new StackLayout() { Children = { btn, combo } };
}
private void Btn_Clicked(object sender, EventArgs e)
{
combo.IsDropDownOpen = true;
}
private void InitList()
{
list = new List<string>();
list.Add("AAAAA");
list.Add("BBBBB");
list.Add("CCCCC");
list.Add("DDDDD");
list.Add("EEEEE");
list.Add("FFFFF");
list.Add("GGGGG");
list.Add("HHHHH");
list.Add("KKKKK");
list.Add("IIIII");
}
}