ComponentOne True DBGrid for WinForms
True DBGrid for WinForms Tutorials / Tutorial 7: Displaying Translated Data with the Built-In Combo
In This Topic
    Tutorial 7: Displaying Translated Data with the Built-In Combo
    In This Topic

    In this tutorial, you will learn how to use the ValueItems object to display translated text and enable the grid's built-in drop-down combo for editing—all without writing a single line of code.

    Complete the following steps:

    1. Start with the project created in Tutorial 6: Defining Unbound Columns in a Bound Grid.
    2. Make sure the C1TrueDBGrid has focus, then click the ellipsis button next to the Columns property in the Properties window. This brings up the C1TrueDBGrid Designer.
    3. Select the CustType column member. Then in the left pane, click the expand icon next to the Valueitems property. This will display all of the members of the Valueitems object.
    4. Click on the ellipsis button next to the Values property in the C1TrueDBGrid Designer. This brings up the ValueitemCollection Editor.
    5. In the left pane create five new ValueItem objects by clicking on the Add button five times. Notice that a ValueItem has two properties: DisplayValue and Value.
    6. Enter the following DisplayValue/Value pairs into the right pane, then close the ValueItemCollection Editor:
      DisplayValue Value
      Value 0
      Prospective 1
      Normal 2
      Buyer 3
      Distributor 4
      Other 5
    7. Under the Valueitems object in the C1DataColumn Editor, set the Presentation property to ComboBox, and the Translate property to True.
    8. Click the OK button at the bottom of the Property Pages dialog box to accept the changes.

    Run the program and observe the following:


    This concludes this tutorial; you've successfully completed displaying translated data with the built-in combo.