Hi,
I'm using AutoCompleteBox from Codeplex.com
Is there a way for oblige the user to select only items shown in list?
I would avoid that user can to insert custom words in database.
Thanks.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tom MohanPosted Apr 15, 2015, 6:20 AM
Roberto SalemiPosted Apr 15, 2015, 3:37 AM
Hi,
I implemented this control:
private void PropertyAutoCompleteBox_MouseLeave(object sender, MouseEventArgs e)
{
SampleProperty lastRow = (SampleProperty)dgProperties.SelectedItem;
//GET Current Select of AutoCompletBox
if ((sender as AutoCompleteBox).SelectedItem != null)
{
//TODO: fai qualcosa
}
else
ModernDialog.ShowMessage("Selezionare un elemento della lista", "Attenzione", MessageBoxButton.OK);
}
Tom MohanPosted Apr 14, 2015, 12:44 PM
You can give a custom validation for that. Compare the user input value with autocomplete's source(in button click or lostfocus etc). If its not there in autocomplete's source then throw a message.