HierarchicalDataSourceConverter Class
Provides a type converter that can retrieve a list of the hierarchical data sources that are accessible to the current component.
Assembly: System.Design (in System.Design.dll)
The HierarchicalDataSourceConverter class provides methods that can be used to retrieve a list of the hierarchical data sources that are accessible to the current design-time component.
The HierarchicalDataSourceConverter type converter is used by Microsoft Visual Studio to provide the values that appear in the list of data sources in the Properties window.
Caution: |
|---|
You should never access a type converter directly. Instead, call the appropriate converter by using the TypeDescriptor class. For more information, see the examples in TypeConverter. |
For more information about type converters, see the TypeConverter base class and How to: Implement a Type Converter.
The following code example demonstrates how to associate a HierarchicalDataSourceConverter with a hierarchical data source property that is contained within a custom control.
[
ToolboxData("<{0}:MyCustomHierarchicalControl runat=server> </{0}:MyCustomHierarchicalControl>")
]
public class MyCustomHierarchicalControl : TreeView
{
private object _dataSource;
[TypeConverter(typeof(HierarchicalDataSourceConverter))]
public override object DataSource
{
get
{
return _dataSource;
}
set
{
if (value != null)
{
ValidateDataSource(value);
}
_dataSource = value;
OnDataPropertyChanged();
}
}
// Define rest of custom control implementation.
// ...
}
- SecurityPermission
for calling unmanaged code. Demand value: Demand; Associated enumeration: UnmanagedCode.
System.ComponentModel::TypeConverter
System.Web.UI.Design::DataSourceConverter
System.Web.UI.Design::HierarchicalDataSourceConverter
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.
Caution: