net90_PropertyGridHelpers.UIEditors_AutoCompleteComboBoxEditor - dparvin/PropertyGridHelpers GitHub Wiki
Provides a UITypeEditor that shows an auto-complete-enabled drop-down list using an AutoCompleteComboBox
, allowing quick selection of string values within a PropertyGrid.
public class AutoCompleteComboBoxEditor : DropDownVisualizer<AutoCompleteComboBox>
name | description |
---|---|
AutoCompleteComboBoxEditor() | The default constructor. |
Converter { get; set; } | Gets or sets the EnumConverter used to convert between the displayed text in the combo box and the corresponding enum value. |
override EditValue(…) | Displays an AutoCompleteComboBox editor in a dropdown and returns the updated value after editing completes. Supports dynamic item lists and enum mapping when configured. |
This editor supports auto-complete behavior based on a configurable AutoCompleteSource and AutoCompleteMode as defined by the AutoCompleteSetupAttribute
. For CustomSource, the list of suggestions can be provided:
- Directly via string array
- From an enum's names
- From a public static
string[] Values
property on a class
When configured with an enum type, the editor displays the enum's names, and returns the selected enum value rather than a string. Otherwise, the selected string is returned.
Apply this editor to a string property like this:
[AutoCompleteSetup(AutoCompleteSource.FileSystem)]
[Editor(typeof(AutoCompleteComboBoxEditor), typeof(UITypeEditor))]
public string FilePath { get; set; }
[AutoCompleteSetup(typeof(ConsoleColor))]
[Editor(typeof(AutoCompleteComboBoxEditor), typeof(UITypeEditor))]
public string FavoriteColor { get; set; }
[AutoCompleteSetup("Red", "Green", "Blue")]
[Editor(typeof(AutoCompleteComboBoxEditor), typeof(UITypeEditor))]
public string CustomColor { get; set; }
- class DropDownVisualizer<TControl>
- class AutoCompleteComboBox
- class AutoCompleteSetupAttribute
- namespace PropertyGridHelpers.UIEditors
- assembly PropertyGridHelpers
- AutoCompleteComboBoxEditor.cs