Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Dig In to Drag-once Data Binding : Page 2

Visual Studio 2005 offers productivity features that will reduce the tedium of building forms. Learn how the Data Sources Window will help you build forms faster.


advertisement
"Connect the Dots"
 
Figure 1: Form1 Bound to Customers.
While it's very helpful to create UI from a new tool window, developers like to work in different styles. Some developers prefer working from the Toolbox. In addition to the Drag-Once Databinding from the Data Sources Window, the Data Sources Window also has a feature the VB team calls "Connect the Dots." To use it, developers lay out their form from the ToolBox and then drag from the Data Sources Window onto existing controls. Rather than create a new control, the Data Sources Window will establish the databinding to the default binding property of the existing control using some new databinding attributes. Since we assume the developer has already designed the user interface, Visual Studio will not create labels or change the name of the controls (see Figure 1). Data Source Types
The Data Sources Window supports different types of data sources and each type is handled slightly differently.

The DataConnector is a new WinForms control that wraps the FX 1.0 CurrencyManager and provides the ability to bind to types, in addition to instances of component objects.
Typed Datasets. Any typed DataSets defined in the current project with an XSD file will automatically be displayed in the Data Sources Window. If you've defined your own class that inherits from DataSet it will not be added automatically. However, you can use the Object Data Source Type to add it manually. Each DataTable of the DataSet will be listed with the corresponding list of columns. After Beta 1 the foreign keys and relations will also be displayed. Web services. Similar to DataSets, any Web service references that have been added will also automatically display in the Data Sources Window. Visual Studio 2005 will evaluate each Web method and it will display the public properties of the object returned by that method. For instance, the GetBook method on a Web service may return a Book object. The Data Sources Window would display the public properties of the Book object within the Data Sources Window. For Beta 1 you'll need to do a relatively simple work around to get the properties of the object to be visible in the Data Sources Window. See the sidebar, "Running WSDL.exe for Web services."

User Defined Objects. It is up to the developer to define the specific implementation of user defined objects. In Visual Studio 2005 you will no longer need to inherit from Component, implement specific interfaces, or even provide a default constructor. You just need to create public properties.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap