DesignerDataSourceView Class
Serves as the base class for design-time data source view classes.
Assembly: System.Design (in System.Design.dll)
System.Web.UI.Design.DesignerDataSourceView
System.Web.UI.Design.WebControls.EntityDesignerDataSourceView
System.Web.UI.Design.WebControls.LinqDesignerDataSourceView
System.Web.UI.Design.WebControls.ObjectDesignerDataSourceView
System.Web.UI.Design.WebControls.SiteMapDesignerDataSourceView
System.Web.UI.Design.WebControls.SqlDesignerDataSourceView
System.Web.UI.Design.WebControls.XmlDesignerDataSourceView
| Name | Description | |
|---|---|---|
![]() | DesignerDataSourceView(IDataSourceDesigner, String) | Initializes a new instance of the DesignerDataSourceView class using the specified data source designer and view name. |
| Name | Description | |
|---|---|---|
![]() | CanDelete | Gets a value indicating whether the DataSourceView object that is associated with the current DataSourceControl object supports the ExecuteDelete method. |
![]() | CanInsert | Gets a value indicating whether the DataSourceView object that is associated with the current DataSourceControl object supports the ExecuteInsert method. |
![]() | CanPage | Gets a value indicating whether the DataSourceView object that is associated with the current DataSourceControl object supports paging through the data that is retrieved by the ExecuteSelect method. |
![]() | CanRetrieveTotalRowCount | Gets a value indicating whether the DataSourceView object that is associated with the current DataSourceControl object supports retrieving the total number of data rows instead of the data itself. |
![]() | CanSort | Gets a value indicating whether the DataSourceView object that is associated with the current DataSourceControl object supports a sorted view on the underlying data source. |
![]() | CanUpdate | Gets a value indicating whether the DataSourceView object that is associated with the current DataSourceControl object supports the ExecuteUpdate method. |
![]() | DataSourceDesigner | Gets a reference to the designer that created this DesignerDataSourceView control. |
![]() | Name | Gets the name of the view as provided when this instance of the DesignerDataSourceView class was created. |
![]() | Schema | Gets a schema that describes the data source view that is represented by this view object. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetDesignTimeData(Int32, Boolean) | Generates design-time data that matches the schema of the associated data source control using the specified number of rows, indicating whether it is returning sample data or real data. |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
Notes to Inheritors:
When you inherit from the DesignerDataSourceView class, you must override the GetDesignTimeData method either to create sample data that conforms to the Schema property, or to return real data from the data source.
The following code example shows how to create a custom DesignerDataSourceView object along with a custom IDataSourceViewSchema class and two custom IDataSourceFieldSchema classes.
This example is part of a larger sample for the DataSourceDesigner class.
// A design-time data source view public class CustomDesignDataSourceView : DesignerDataSourceView { private ArrayList _data = null; public CustomDesignDataSourceView( CustomDataSourceDesigner owner, string viewName) : base(owner, viewName) {} // Get data for design-time display public override IEnumerable GetDesignTimeData( int minimumRows, out bool isSampleData) { if (_data == null) { // Create a set of design-time fake data _data = new ArrayList(); for (int i = 1; i <= minimumRows; i++) { _data.Add(new BookItem("ID_" + i.ToString(), "Design-Time Title 0" + i.ToString())); } } isSampleData = true; return _data as IEnumerable; } public override IDataSourceViewSchema Schema { get { return new BookListViewSchema(); } } // Allow getting the record count public override bool CanRetrieveTotalRowCount { get { return true; } } // Do not allow deletions public override bool CanDelete { get { return false; } } // Do not allow insertions public override bool CanInsert { get { return false; } } // Do not allow updates public override bool CanUpdate { get { return false; } } // Do not allow paging public override bool CanPage { get { return false; } } // Do not allow sorting public override bool CanSort { get { return false; } } }
// A custom View Schema class public class BookListViewSchema : IDataSourceViewSchema { public BookListViewSchema() { } // The name of this View Schema public string Name { get { return "BookList"; } } // Build a Field Schema array public IDataSourceFieldSchema[] GetFields() { IDataSourceFieldSchema[] fields = new IDataSourceFieldSchema[2]; fields[0] = new CustomIDFieldSchema(); fields[1] = new CustomTitleFieldSchema(); return fields; } // There are no child views, so return null public IDataSourceViewSchema[] GetChildren() { return null; } } // A custom Field Schema class for ID public class CustomIDFieldSchema : IDataSourceFieldSchema { public CustomIDFieldSchema() { } // Name is ID public string Name { get { return "ID"; } } // Data type is string public Type DataType { get { return typeof(string); } } // This is not an Identity field public bool Identity { get { return false; } } // This field is read only public bool IsReadOnly { get { return true; } } // This field is unique public bool IsUnique { get { return true; } } // This field can't be longer than 20 public int Length { get { return 20; } } // This field can't be null public bool Nullable { get { return false; } } // This is a Primary Key public bool PrimaryKey { get { return true; } } // These properties do not apply public int Precision { get { return -1; } } public int Scale { get { return -1; } } } // A custom Field Schema class for Title public class CustomTitleFieldSchema : IDataSourceFieldSchema { public CustomTitleFieldSchema() { } // Name is Title public string Name { get { return "Title"; } } // Type is string public Type DataType { get { return typeof(string); } } // This is not an Identity field public bool Identity { get { return false; } } // This field is not read only public bool IsReadOnly { get { return false; } } // This field is not unique public bool IsUnique { get { return false; } } // This field can't be longer than 100 public int Length { get { return 100; } } // This field can't be null public bool Nullable { get { return false; } } // This is not the Primary Key public bool PrimaryKey { get { return false; } } // These properties do not apply public int Precision { get { return -1; } } public int Scale { get { return -1; } } }
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
.jpeg?cs-save-lang=1&cs-lang=csharp)
.jpeg?cs-save-lang=1&cs-lang=csharp)
.jpeg?cs-save-lang=1&cs-lang=csharp)