Creating a Typed DataViewSet
In This Topic
To create a new typed DataViewSet, complete the following basic operations:
- Select Add New Item from the Project menu in Visual Studio. Alternatively, right-click the project node in the Solution Explorer and select Add | New Item from its context menu.
The Add New Item dialog box of VS IDE appears.
- Select the C1Typed DataViewSet item and click Add. A new project item that represents a typed DataViewSet will be created.
The C1TypedDataViewSet designer appears.
- From the Toolbox, add a DataSet control to the component tray at the bottom of the C1TypedDataViewSet designer by performing a drag-and-drop operation.
- The Add DataSet dialog box appears. The Typed dataset option is selected, click OK.
- From the Properties window, assign the DataSet control to the DataSet property of the C1TypedDataViewSet.
The C1TypedDataViewSet designer is similar to the untyped C1DataViewSet, but it has added support that allows you to create specifically typed event handlers for views and the typed C1DataViewSet itself, as well as for any component placed on the component tray.
To create the specifically typed event handlers for views, simply double-click the event item in the Events list of the VS IDE Properties window, which is accessed by selecting the Events button . An event handler method definition will be created in the code file.
As for other types of project level components, typed DataViewSet is represented by the following code files:
- A code file for a user's custom code with a filename.ext name template (you can define additional members for viewset and dataview classes, event handler methods are also here).
- A code file with the filename.Designer.ext name template that contains auto generated code and should not be changed manually.
To use a typed DataViewSet instance in forms:
- Rebuild your application. A Toolbox item that represents this ViewSet appears under the <Project Name> Components tab at the top of the Toolbox.
- From there you can place it on a Form using a drag-and-drop operation.
See Also