Step 5: Extending the generated code

After you have created the RapTier project and generated code, you may want to customize the output code to suite your specific requirements. Let's consider a few examples so you could see for yourself how easy you can modify the generated code.

We will perform the following tasks:

a. Delete the Order ID label and the text box.
b. Replace the Order Date, Required Date, and Shipped Date text boxes with the DateTimePicker controls.
c. Replace Customer ID, Employee ID, Ship Via text boxes with the lookup combo-boxes.
d. Add a DataGrid Control to display the data in a master-detail format.



a. Delete the Order ID label and the text box


b. Replace the Order Date, Required Date, and Shipped Date text boxes with DateTimePicker controls
RowEditor. Extending the generated code

Figure 5.1


WinForm Application generated by RapTier

Figure 5.2



c. Replace Customer ID, Employee ID, Ship Via text boxes with the lookup combo-boxes
C#:
_customerComboBox.DataSource = dataSource;
_customerComboBox.ValueMember = "Customers.CustomerID";
_customerComboBox.DisplayMember = "Customers.CompanyName";
_customerComboBox.DataBindings.Add("SelectedValue", dataSource, "Orders.CustomerID");

VB.NET:
_customerComboBox.DataSource = dataSource
_customerComboBox.ValueMember = "Customers.CustomerID"
_customerComboBox.DisplayMember = "Customers.CompanyName"
_customerComboBox.DataBindings.Add("SelectedValue", dataSource, "Orders.CustomerID")

The Figures 5.4 and 5.5 show the result of the above changes.



Figure 5.3

WinForm Application generated by RapTier

Figure 5.4



d. Add a DataGrid Control to display the data in a master-detail format


Figure 5.5

WinForm Application generated by RapTier

Figure 5.6

Conclusion

This tutorial has been written to give RapTier users an insight into how the generated applications can be customized to fit your development requirements.

If you have questions or comments please address them to our support team at support@SharpPower.com. We welcome your feedback.

For more information about the generated classes, methods and properties see the User Guide section in the documentation.