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.
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.
DJDavis Jebaraj Syncfusion Team June 8, 2004 12:54 PM
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)
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;