We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

autocomplete.matchitem - sample code?

I'd like to know if it is possible to customize the list of possible matches presented by the autocomplete control using the matchitem event. However there is no sample source available, and the help file does not elaborate what the event parameters mean. Can anyone help me dig deeper into this?

1 Reply

LS Lingaraj S Syncfusion Team June 3, 2010 11:00 AM UTC

Hi James,

Thank you for your interest in Syncfusion products.

Please try using MatchMode as MatchMode.Manual to customize the possible matches in AutoComplete as shown below.

private void Form1_Load(object sender, EventArgs e)
{
... // Other codes
this.autoComplete1.SetAutoComplete(this.textBox1, Syncfusion.Windows.Forms.Tools.AutoCompleteModes.AutoSuggest);
this.autoComplete1.DataSource = dt;
this.autoComplete1.MatchItem += new Syncfusion.Windows.Forms.Tools.AutoCompleteMatchItemEventHandler(autoComplete1_MatchItem);
this.autoComplete1.MatchMode = Syncfusion.Windows.Forms.Tools.AutoCompleteMatchModes.Manual;
}
void autoComplete1_MatchItem(object sender, Syncfusion.Windows.Forms.Tools.AutoCompleteMatchItemEventArgs args)
{
if (args.PossibleMatch.StartsWith("TA"))
{
args.Cancel = true;
}
}


Refer the sample from below link.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=WindowsFormsApplication5196913998.zip

Please let me know if you have any queries.

Regards,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon