In our case, we found that the
DataBoundControlDesigner base class proved more than adequate and reduced the amount
of code required to provide design-time support. We strongly recommend looking first at the
customized designer bases classes available in the .NET Framework 2.0 or later when adding
design-time support in your own server controls.
The IDataSourceProvider Interface
IDataSourceProvider is an interface for control designers to use to provide access to a data
source at design time when the server control requires design-time support for DataMember or
DataField. The base designer class DataBoundControlDesigner implements this interface for
you in inheriting from that base class. Table 11-5 lists the members of IDataSourceProvider
and provides a short description of each.
GetSelectedDataSource provides access to design-time data sources such as a DataSet
component through design-time services. GetResolvedSelectedDataSource is the place where
component developers implementing a custom data-bound control designer class can provide
support for objects that implement IListSource (i.e., DataSet), which can contain multiple
objects that implement IEnumerable (i.e., DataTable), mapping the selected IEnumerable object
to the DataMember property for the server control.
Pages:
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744