Drop down list datasource
The file facilitating the definition of drop-down lists is called
ComboDefinition. Its main goal is to define sets of values for drop-down lists and make them reusable.
Location in the system
Its physical location is in the ComboDefinitions folder. The ComboDefinition always occurs as a reference, it cannot be used in itself. Its location within the system is shown in the following figure:
- Datasource definition
- Definition of values and display fields
SELECT [PeopleID], [Name]
FROM [People] WITH(NOLOCK)
WHERE [Deleted] = 0
AND [IsGroup] = 0
ORDER BY [Name] ASC
For the datasource definition two nodes can be used, one of them defines the type of the relationship, while the other specifies the SELECT statement.
SourceType: The type of the relationship maybe
Source: in case of a
SELECT statement runs a query on the list of values. In the WHERE clause, it is advisable to sort the data and insert the
1=1 expression for a later filtering. The system will replace this
1=1 condition with the appropriate filter expression. The SELECT statement must have at least two fields.
Definition of value and display fields
One of the two fields queried by a select statement represents the value of the ComboBox, while the other signifies the description to be displayed. In the ComboBox, a list of key-value pairs is displayed.
- KeyColumn: A value (key) representing one row of the ComboBox.
- ValueColumn: A displayable field related to the key.