Intersoft WebGrid Documentation
Design-time support for DataSourceControl
See Also Send comments on this topic.

Glossary Item Box

WebGrid.NET Enterprise 5.0 boosts developer's productivity by introducing various ways to connect to a DataSource control in design-time through rich designers and wizards.'

 

SmartTag Action Panel

The easiest way to start with data binding is through SmartTag Action Panel. By default, when you drop a new instance of WebGrid to designer, the SmartTag will appear automatically as shown in the following image.

The Choose Data Source dropdown enables you to quickly connect to a DataSource control available in the web page. The dropdown will list all valid DataSource controls. You can also click on <New data source...> item to create a new DataSource control from scratch. This feature is reflected directly to DataSourceControlID property of WebGrid.

When connected to a DataSource control that supports multiple views such as in ISDataSource control, the View Names dropdown will list available views defined in the specified DataSource control such as shown in above image. This feature is reflected directly to DataMember property of WebGrid.

 

Retrieve Structure and Hierarchical Structure Context Command

When you have modification to DataSource schema which is already assigned to WebGrid, you do not need to change the DataSourceControlID or DataMember property. Instead, you can simply re-retrieve the schema (structure) by using the commands in control's context menu. Refer to the following image for details.

Note that if the existing WebGrid already has structures defined such as Columns, GroupColumn, SortColumns etc - the Retrieve Structure and Retrieve Hierarchical Structure will override existing structure with new schema defined in the DataSource control.

 

Flat table DataSource control

When the WebGrid is connected to flat DataSource control, such as AccessDataSource or SqlDataSource control, the WebGrid DataSource Connect wizard dialog box will appear, such as illustrated in the following image.

The DataSource connection wizard integrates deeply with Visual Studio 2005® to provide rich design-time experience, such as automatic DataSource detection when the DataSourceID property has changed. The wizard also has the ability to retrieve the DataSource schema available in the DataSource control.
As seen in above image, the view names dropdown list and retrieve hierarchical structure option are automatically disabled. In flat-view DataSource control, the DataMember does not need to be set as the DataSource control should contain only 1 table view. The flat table view is also called as DefaultView data member.

 

XML DataSource control

WebGrid V5.0 exclusively supports XmlDataSource control and display the XML data as hierarchical Grid to simulate TreeView. For more information about XmlDataSource control support in WebGrid V5.0, see Advanced DataSourceControl support.

When connected to an XMLDataSource control in design-time through either SmartTag Action Panel or Property Window, the XMLDataSource Connect wizard will be displayed as shown in following image.

The XmlDataSource Connect wizard has two primary features:


Several notes related to XmlDataSource control support:

 

Hierarchical DataSource control

Similar to flat-view DataSource control and XMLDataSource control, WebGrid automatically displays DataSource Connect wizard when a valid multi-view (hierarchical) DataSource control is assigned to WebGrid.

The following image shows the wizard for Hierarchical DataSource control connection.

When connected to a valid hierarchical DataSource control, WebGrid allows you to perform the following actions in designer:

In order for Retrieve Hierarchical Structure to work successfully, ensure you have defined the table's relationship properly using DataSet Designer.

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.