DataSourceDesigner Class
Provides design-time support in a design host for the DataSourceControl class.
Assembly: System.Design (in System.Design.dll)
The DataSourceDesigner class is the base class for data source designers, such as the SqlDataSourceDesigner, AccessDataSourceDesigner, and ObjectDataSourceDesigner classes. If you create a new data source control, you might also want to create a custom control designer for your control and derive it from the DataSourceDesigner class.
The DataSourceDesigner class has two event methods: the OnDataSourceChanged and OnSchemaRefreshed methods. Both of these events can be temporarily disabled with the SuppressDataSourceEvents method, which sets the SuppressingDataSourceEvents property. The event methods can be enabled again with the ResumeDataSourceEvents method.
There are two static methods that you can use to evaluate the equivalency of schemas or views without creating an instance of the class:
The SchemasEquivalent method compares two schemas.
The ViewSchemasEquivalent method compares the schemas of two views.
To provide commands for the action list menu at design time in a derived class, you must override the ActionLists property to return a custom DesignerActionListCollection object with custom items that are derived from the DesignerActionList object.
The following code example shows how to use a custom data source control with several other small custom classes, as listed in the following table.
Custom class | Derived from |
|---|---|
CustomDataSource | |
CustomDataSourceDesigner | DataSourceDesigner |
CustomDataSourceView | |
CustomDesignDataSourceView | |
BookListViewSchema | |
CustomIDFieldSchema | |
CustomTitleFieldSchema | |
BookItem (A two-field data structure.) |
After compiling the code example, open the .aspx page in Design view and then set the DataSourceID property to the ID of the custom data source control.
- SecurityPermission
for calling unmanaged code. Demand value: Demand. Permission value: UnmanagedCode
System.ComponentModel.Design::ComponentDesigner
System.Web.UI.Design::HtmlControlDesigner
System.Web.UI.Design::ControlDesigner
System.Web.UI.Design::DataSourceDesigner
System.Web.UI.Design.WebControls::LinqDataSourceDesigner
System.Web.UI.Design.WebControls::ObjectDataSourceDesigner
System.Web.UI.Design.WebControls::SqlDataSourceDesigner
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.