Click or drag to resize

ListBox.FillUsingBySortedList Method (Typed)

X#
Specify the set of values to be displayed in the list box, using an array or a data server. These values act as a constraint on the values that may be entered in the list box, and optionally as a translation between program values and display values.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD FillUsingBySortedList(
	oList AS SortedList<STRING, USUAL>
) AS VOID
Request Example View Source

Parameters

oList
Type: SortedListString, Usual
Sorted List of String/Usual pairs
Remarks
A list box shows the set of valid values for a field. Depending on what type of list box is used, the set of values may act as a constraint on the values that may be retrieved or only as a suggestion. Two sets of values may be specified, allowing for translation of values between the displayed, "human-readable" representation and the internal, programmatic value. The FillUsing() method provides a way of specifying the values to be included in the list all at once, instead of constructing the list item by item with the AddItem() method.
Tip Tip
The list box control may be associated with a database field, just like any other control. Do not confuse this primary field linkage with the possibility of linking the list box to a secondary server used for populating the list.
Examples
Create a list box with different currencies, showing an explicit representation to the user but using a different representation internally:
X#
 1METHOD Init(...) CLASS OrderWindow
 2...
 3oLBCurrency := ListBox{SELF,LBCURRENCY_ID}
 4oLBCurrency:FillUsing({;
 5{"U.S. Dollars","USD"},;
 6{"Can. Dollars","CDN"},;
 7{"Mexican Pesos","MEX"},;
 8{"Yen","YEN"},;
 9{"British Pounds","UK"},;
10{"German Marks","DM"};
11})
12oLBCurrency:Show()
Create a list box that shows the products available in the product table:
X#
1METHOD Init(...) CLASS OrderWindow
2...
3oLBProducts := ListBox{SELF,LBPRODUCTS_ID}
4oLBProducts:FillUsing(oDBProducts,#ProdName,#ProdNo)
5oLBProducts:Show()
See Also