Name
DesignTimeData
Synopsis
This class provides shared helper methods that the design-time host (IDE) can
use to generate “dummy” information for a sample rendering of a complex control.
Typically, this class is used with table controls, as maintaining a database
connection in design mode would be too resource intensive, and the data source
provider may not even be available. Using the CreateDummyDataTable()
method, a
default table is created that uses no information from the actual data source.
This table could be used before a control’s DataSource
property is set.
Visual Studio .NET can also use a minimum amount of information to help
present a design-time rendering of data tables. The GetDataFields()
and GetDataMembers()
methods
retrieve a basic amount of information about the structure of the data source,
which is then used when a dummy table is created with CreateSampleDataTable()
. The GetDesignTimeDataSource()
method
adds sample rows into the specified data table control.
Public NotInheritable Class DesignTimeData ' Public Shared Fields public Shared ReadOnly DataBindingHandler As EventHandler // =System.EventHandler ' Public Shared Methods Public Shared Function CreateDummyDataTable() As DataTable Public Shared Function CreateSampleDataTable( ByVal referenceData As System.Collections.IEnumerable) As DataTable Public Shared Function GetDataFields( ByVal dataSource As System.Collections.IEnumerable)_ As PropertyDescriptorCollection Public Shared Function GetDataMember( ByVal ...
Get ASP.NET in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.