ComponentOne List for WinForms
In This Topic
    Tutorial 9 – Displaying Translated Data Using Images
    In This Topic

    In this tutorial, you will learn how to use the Translate and DisplayValue properties to display images in the column.

    1. Follow steps 1 through 6 of Tutorial 8 - Displaying Translated Data to create a project with a C1List control bound to a Data Set.
    2. Click the ellipsis button next to the Columns property of C1List1 in the Properties window. This will bring up the C1List Designer. Select ContactType in the right pane, and in the left pane expand the ValueItems property. Set the Translate property to True.

    3. Click the ellipsis button next to the Values property and the ValueItem Collection Editor appears. Click the Add button and the first ValueItem member appears in the left pane. In the right pane enter 0 in the Value box. For the DisplayValue, click the ellipsis button and find the phone.bmp file that came with this tutorial. Click Open and a phone icon appears next to the DisplayValue.
    4. Add two more members with the following properties to the Members list:
      Member DisplayValue Value
      1 mail.bmp 1
      2 person.bmp 2

      The ValueItem collection should look like the following:

    Run the program and observe the following:

    In the ContactType column C1List1 displays the icons that you entered as DisplayValues in the ValueItem Collection Editor. Setting the Translate property to True displays the DisplayValues instead of the data values entered for the Value property.

    This concludes the tutorial.