Home Forums WinForms controls Xceed Grid for WinForms Auto complete on combo boxes Reply To: Auto complete on combo boxes

User (Old forums)
Member
Post count: 23064

There is another option for the GridComboBox, AutoCompleteMode. This can be set to: None, Append, Suggest, SuggestAppend.

This will give you traditional autocomplete.

I have found an issue with this tough. The following code sets up a drop down list and autocompletion:

void EnteringEdit(object sender, Xceed.Grid.EnteringEditEventArgs e) {
Xceed.Grid.Editors.GridComboBox box = new Xceed.Grid.Editors.GridComboBox();
box.DropDownStyle = ComboBoxStyle.DropDown;
box.AutoCompleteMode = AutoCompleteMode.None;
box.AutoCompleteSource = AutoCompleteSource.CustomSource;
foreach (string s in stringList) { // Definted elsewhere
box.Items.Add(s);
}
box.AutoCompleteCustomSource.AddRange(sa);
}
}

e.CellEditor = box;
}

If I select the drop down menu and then hit enter, the value in the cell is wiped out and set to “”.

thanks,
kiwi

Imported from legacy forums. Posted by kiwi (had 384 views)