ComponentOne List for WinForms
In This Topic
    Tutorial 2 - Binding C1Combo to a DataSet
    In This Topic

    In this tutorial, you will learn how to bind C1Combo to a DataSet. You will also learn about the basic properties of the C1Combo control. You will then be able to run the program and observe the run-time features of the combo.

    1. Create a new .NET 2.0 project.
    2. Double-click the C1Combo icon in Visual Studio's Toolbox to add it to the Form. Note: See Adding the C1List Components to a Project for information on adding a component to the Toolbox.
    3. Go to the DataSource property and select Add Project Data Source from the drop-down. In the adapter's Data Source Configuration Wizard, either select a connection to C1NWind.mdb or create a new connection to this database. On the Choose your database objects page of the wizard, select all fields in the Composer table and type "DataSet1" into the DataSet name box, and then finish out the wizard.
      At this point your .NET design window and form should look like the following:
    4. Visual Studio 2005 adds the following code to the Form_Load event:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Me.ComposerTableAdapter.Fill(Me.DataSet1.Composer)
      

      To write code in C#

      C#
      Copy Code
      this.ComposerTableAdapter.Fill(this.dataSet1.Composer);
      

    Run the program and observe the following:

    Note: When C1Combo has the focus, press F4 to open the drop-down box.

    To end the program, close the window or press the stop button on the toolbar.

    This concludes the tutorial.