Skip to content

EnumEditorAttribute class

namespace: Serenity.ComponentModel   assembly: Serenity.Net.Core

Indicates that the target property should use a "Enum" editor.

[AttributeUsage(AttributeTargets.All)]
public class EnumEditorAttribute : CustomEditorAttribute

Public Members

name description
EnumEditorAttribute() Initializes a new instance of the EnumEditorAttribute class.
EnumEditorAttribute(…) Initializes a new instance of the EnumEditorAttribute class for a numeric enum or a StringEnum type, which is needed for a property that is not typed with it, e.g. a string property that holds the values of a StringEnum. (2 constructors)
AllowClear { get; set; } Gets or sets a value indicating whether to allow clearing.
CheckList { get; set; } Shows a multiple editor as a checklist, see CheckList.
Delimited { get; set; } Use comma separated string instead of an array to serialize values.
EnumKey { get; set; } Gets or sets the key of the enum or string enumeration, which is determined from the type of the property when it is typed with one.
Flags { get; set; } Indicates whether the enum should be treated as a flags enum, allowing multiple selections.
MaxSummaryItems { get; set; } How many of the selected members the summary of a checklist, see CheckList, names before it counts the rest, see MaxSummaryItems, of which SummaryCountOnly names none and shows only how many are selected, and SummaryNamesAll names them all, which is what ComboboxEditor.defaults.maxSummaryItems, that the editor uses when it is not set, is by default. The other negative values are reserved for summaries to come.
MinimumResultsForSearch { get; set; } The minimum number of results that must be initially (after opening the dropdown for the first time) populated in order to keep the search field. This is useful for cases where local data is used with just a few results, in which case the search box is not very useful and wastes screen space. AlwaysShowSearch shows it for any number of results, which is what the editor does when it is not set, unless ComboboxEditor.defaults.minimumResultsForSearch says otherwise, and NeverShowSearch, or any other negative value, hides it permanently.
Multiple { get; set; } Allow multiple selection. Make sure your field is a List. You may also set CommaSeparated to use a string field.
PlaceholderIcon { get; set; } The icon of the placeholder, see PlaceholderIcon.
SelectAll { get; set; } Whether a checklist, see CheckList, has an item that selects all the members, or clears them when they are all selected, see SelectAll. Default is true.
const AlwaysShowSearch The value of MinimumResultsForSearch that shows the search field for any number of results, see AlwaysShowSearch.
const Key Editor type key
const NeverShowSearch The value of MinimumResultsForSearch that hides the search field permanently, see NeverShowSearch.
const SummaryCountOnly The value of MaxSummaryItems that names none of the selected items, and shows only how many are selected, see SummaryCountOnly.
const SummaryNamesAll The value of MaxSummaryItems that names all the selected items, see SummaryNamesAll.

See Also