Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataSourceIDConverter.CanConvertFrom Method (ITypeDescriptorContext, Type)


Gets a value indicating whether this converter can convert an object in the specified source type to the native type of the converter.

Namespace:   System.Web.UI.Design.WebControls
Assembly:  System.Design (in System.Design.dll)

public override bool CanConvertFrom(
	ITypeDescriptorContext context,
	Type sourceType


Type: System.ComponentModel.ITypeDescriptorContext

An object implementing the ITypeDescriptorContext that provides information about a context to a type converter so that the type converter can perform a conversion.

Type: System.Type

The Type of the object for which conversion is being requested.

Return Value

Type: System.Boolean

true if sourceType is a string; otherwise, false.

The ConvertFrom method can only convert from a string, so the CanConvertFrom only returns true when sourcetype is a string.

The CanConvertFrom does not use the context parameter.

.NET Framework
Available since 2.0
Return to top
© 2016 Microsoft