ComponentOne List 8.0 for ActiveX
Tutorial 8 - Displaying Translated Data

In this tutorial, you will learn how to use the ValueItems collection to display translated text without writing a single line of code.

  1. Start with the project created in Tutorial 7.

  2. Right-click TDBList1 to display its context menu.

  3. Choose Properties to display the Property Pages dialog box. Select the Values property page by clicking the Values tab. This property page is used to specify the ValueItems collection associated with a column.

  4. Drop down the Column combo box and select Column1 (CustType).

  5. Check the Translate box to instruct the list to translate the data in Column1 before displaying it. Note that the list at the bottom of the property page now displays two columns labeled Value and DisplayValue.

  6. Now enter the Value - DisplayValue pairs in the list as follows:

    Example Title
    Copy Code
    Value   Display Value
    
    1       Prospective
    
    2       Normal
    
    3       Buyer
    
    4       Distributor
    
    5       Other
    

    Entries in the Value column are data values from the CustType field in the database table.  The list treats the Value property as a string. Entries in the DisplayValue column are translated values to be displayed in the CustType column of the list.  For example, a CustType of 1 will be displayed as Prospective, 2 will be displayed as Normal, and so forth.

    Some databases store numbers with a leading space character to hold the place of a minus sign, so it may be necessary to prefix Value column entries with a space.

    When you are finished entering data, the Values property page should look like this.

  7. Click the OK button at the bottom of the Property Pages dialog box to accept the changes.

Run the program and observe the following:

To end the program, press the End button on the Visual Basic toolbar.You have successfully completed Tutorial 8.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback