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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Autocomplete: Do not allow values not in the list

Thread ID:





14868 Jun 7,2004 04:03 PM UTC Jun 8,2004 04:54 PM UTC General Discussion 2
Tags: General Discussion
Asked On June 7, 2004 04:03 PM UTC

I''m using a buttonedit field and allowing autocomplete with append only enabled. My button displays a treeview that the user can select from or autocomplete types ahead the value''s in the tree. I only want to allow the user to type data that is in the list. Can this be accomplished with the tools defined? I''ve attached my project so you can understand what I''m after. Quicken_752.zip

Replied On June 8, 2004 01:13 PM UTC

The ComboBoxAutoComplete looks like it might work. However, I don''t want to display the concatenated text (see attachment in my previous post). Instead I want to display a tree view. There is an OverrideCombo property that I can set but it doesn''t seem to do anything and there''s no documentation. Any help would be much appreciated.

Davis Jebaraj [Syncfusion]
Replied On June 8, 2004 04:54 PM UTC

Hi, You can prevent values not in the AutoComplete list by handling the KeyPress event of the ButtonEdit''s TextBox and validating the input text through the AutoComplete control. this.buttonEdit1.TextBox.KeyPress += new KeyPressEventHandler(this.HandleTextBoxKeyPress); private void HandleTextBoxKeyPress(object sender, KeyPressEventArgs args) { if(Char.IsLetterOrDigit(args.KeyChar)) { string modifiedText = this.buttonEdit1.TextBox.Text.Substring(0, this.buttonEdit1.TextBox.SelectionStart) + args.KeyChar + this.buttonEdit1.TextBox.Text.Substring(this.buttonEdit1.TextBox.SelectionStart+this.buttonEdit1.TextBox.SelectionLength); if(this.autoComplete1.GetMatchesCount(modifiedText) == 0) args.Handled = true; } } Regards, Davis


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon