Holds a collection of PicklistItem objects for use in an IField object. The set of picklists available in the application is available via the Picklists collection.

Namespace: NetQuarry
Assembly: EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.5.2.0)

Syntax

C#
[SerializableAttribute]
public class Picklist : ICloneable, IEAPBase, 
	ICacheable
Visual Basic
<SerializableAttribute>
Public Class Picklist
	Implements ICloneable, IEAPBase, ICacheable

Remarks

A Picklist represents a domain-specific list of values that can be used to translate the key of an item (typically a foreign key in a database table) to a description. All IField objects have a Picklist property, but Picklists are most often used with ComboBox fields. Some aspects of a picklist are driven by that picklist's PicklistAttrs which is stored in the picklist's PicklistItemInfo object (accessible from the ItemInfo property) along with certain other picklist settings.

Picklists are of a variety of PicklistType:

  • StandardPicklist - This type of list is loaded from the metadata and supports the descriptive text in the current user’s culture (language).
  • SQL - This type of list is loaded from one of the databases (can be an operational database or the repository) and can contain 1 to 5 columns of data:
    1. Column 1 - The Key. Loaded into Value. This is what is stored in the database.
    2. Column 2 - The DisplayText. Loaded into DisplayText. This is what is displayed to the user.
    3. Column 3 - The Discrim. Loaded into Discrim. This is used to create subsets within the picklist (e.g. states for various countries).
    4. Column 4 - The Enabler. Used to control Disabled in Attributes. When this column is in the query the value is treated as an integer where zero/null means disabled and any other value means enabled.
    5. Column 5 - The Group. Loaded into Group.
  • Enum - This list is a 2 column Picklist loaded from a string type name as its source.
  • Intrinsic - These are programmatically-generated, predefined platform lists as identified in IntrinsicPicklists.
    • Countries - The set of countries as provided by the Windows System.Globalization.CultureInfo object.
    • Cultures - The set of cultures as provided by the Windows System.Globalization.CultureInfo object.
    • Currencies - The set of currencies as provided by the Windows System.Globalization.CultureInfo and RegionInfo objects.
    • DaysOfTheWeek - The set of days of the week names as provided by Windows System.Globalization for the current date culture.
    • MonthNames - The set of month names as provided by Windows System.Globalization for the current date culture.
    • Timezones - The set of timezones as obtained from the Windows registry and managed by the platform TimeZones collection.
  • NumericRange - This list is a simple numeric range (generally created dynamically).
  • Custom - This is a custom, programmatically-generated list populated using a class (derived from PicklistDynamic) that has been registered as a CustomPicklist component.

For the most part, Picklists tend to have the LimitToList attribute set. This attribute means that the list has a key (hidden) and text (displayed). For example, if you had a column in a database that held an integer ID for a customer status you might create a Picklist like this:

KeyData
0Active
1Inactive

Remarks

You can use GetList(String, GetListOptions) to programmatically iterate through the items in the picklist.

Inheritance Hierarchy

System..::..Object
  NetQuarry..::..Picklist

See Also