Click or drag to resize
ControlsHelperFillListControlWithEnum Method (ListControl, Type, String, Boolean, Boolean, ListString, ListString)
Fills the specified ListControl with the items created from the specified enum type.

Namespace: CMS.Base.Web.UI
Assembly: CMS.Base.Web.UI (in CMS.Base.Web.UI.dll) Version: 13.0.131
Syntax
C#
public static void FillListControlWithEnum(
	ListControl control,
	Type enumType,
	string resourcePrefix = null,
	bool sort = false,
	bool useStringRepresentation = false,
	List<string> excludedValues = null,
	List<string> selectedCategories = null
)

Parameters

control
Type: System.Web.UI.WebControlsListControl
List control
enumType
Type: SystemType
Enum type
resourcePrefix (Optional)
Type: SystemString
The resource prefix used for the item text localization. Defaults to null.
sort (Optional)
Type: SystemBoolean
Indicates whether the items should be sorted. If true, the items are sorted by the item text after localization, otherwise the order of items corresponds to the enum declaration. Defaults to false.
useStringRepresentation (Optional)
Type: SystemBoolean
Indicates if string representation specified by the EnumStringRepresentationAttribute attribute will be used for the item value. Defaults to false.
excludedValues (Optional)
Type: System.Collections.GenericListString
Exclude values from enumeration
selectedCategories (Optional)
Type: System.Collections.GenericListString
Only enums from selected enum categories will be used.
Remarks
Takes the EnumStringRepresentationAttribute into account when working with the enum values.
See Also