To use the C1SchemaRef component to represent a C1SchemaDef component, complete the following steps:
- Add a C1SchemaDef control to your form and create a data schema.
- Add a new component class file to your project by selecting the Project menu and clicking Add New Item, Component Class.
- Enter a name for the class in the Name text box and click Add.
- Double-click the C1SchemaRef component in the Toolbox to add it to the design surface of the component class file.
- In the Visual Studio Properties window, set the SchemaDef property of the C1SchemaRef to the C1SchemaDef you created in step 1.
Note: When working with multiple files using
C1SchemaRef, the file containing the
C1SchemaDef component must be open.
- Add any desired business logic components such as C1TableLogic and C1DataSetLogic to the component class file.
- For each business logic component, set its SchemaComponent property to the C1SchemaRef component added in step 4.
- If a C1TableLogic component was added, choose a table from the Table property drop-down box in the Visual Studio properties window. If a C1DataSetLogic component was added, select a data set from the DataSetDef property drop-down box.
- In the initialization section of your code, call Add to add a C1SchemaRef component to the list of C1SchemaRef components associated with the C1SchemaDef component.