public class CustomEditor : DataFormEditor<SfAutoComplete>
{
public CustomEditor(SfDataForm dataForm): base(dataForm)
{
}
protected override SfAutoComplete OnCreateEditorView(DataFormItem dataFormItem)
{
return new SfAutoComplete();
}
protected override void OnInitializeView(DataFormItem dataFormItem, SfAutoComplete view)
{
base.OnInitializeView(dataFormItem, view);
this.OnUpdateValue(dataFormItem, view);
}
protected override void OnUpdateValue(DataFormItem dataFormItem, SfAutoComplete view)
{
var cellvalue = this.DataForm.ItemManager.GetValue(dataFormItem);
if (cellvalue != null && view.Text == cellvalue.ToString())
return;
view.Text = cellvalue == null ? string.Empty : cellvalue.ToString();
}
} |
void Handle_ValueChanged(object sender, Syncfusion.SfAutoComplete.XForms.ValueChangedEventArgs e) { if ((sender as SfAutoComplete).Text.Length == 0) { DisplayAlert("Items are empty", "Select an item", "Cancel"); } } |