ClassRadComponentElement
Represents a visual element that integrates with the Visual Studio component model, providing design-time support and data binding capabilities for elements in the Telerik Presentation Framework.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
[ComVisible(false)]
public class RadComponentElement : VisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IBindableComponent, IComponent, IDisposable
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElement
Derived Classes:
Implements:
Inherited Members
Constructors
RadComponentElement()
Declaration
public RadComponentElement()
Properties
CanRaiseEvents
Gets a value indicating whether the component can raise events.
Declaration
protected virtual bool CanRaiseEvents { get; }
Property Value
true if the component can raise events; otherwise, false.
The default implementation always returns true.
Remarks
This property can be overridden in derived classes to control event raising behavior based on component state or other conditions.
Container
Gets the container that contains the component.
Declaration
[Browsable(false)]
public IContainer Container { get; }
Property Value
The IContainer that contains the component, or null if the component is not sited.
Remarks
This property provides access to the design-time container that manages this component's lifetime and provides services for component interaction and resource management.
DataBindings
Gets the collection of data-binding objects for this component.
Declaration
public virtual ControlBindingsCollection DataBindings { get; }
Property Value
A ControlBindingsCollection that contains the data-binding objects for this component.
Implements
Remarks
This collection manages all data binding relationships for the component, allowing properties to be bound to data sources. The collection is created on-demand and provides automatic synchronization between the component's properties and bound data sources.
DesignMode
Gets a value indicating whether the component is currently in design mode.
Declaration
[Browsable(false)]
protected bool DesignMode { get; }
Property Value
true if the component is in design mode; otherwise, false.
Remarks
This property is used to determine if the component is being used in a design-time environment such as Visual Studio. It affects behavior for design-time scenarios versus runtime execution.
Site
Gets or sets the site of the component.
Declaration
[Browsable(false)]
public virtual ISite Site { get; set; }
Property Value
The ISite associated with the component, or null if the component is not sited.
Implements
Remarks
Setting this property integrates the component with the design-time environment, enabling access to designer services and proper design mode state management. When set to null, the component is removed from design mode.
Methods
DisposeManagedResources()
Releases the managed resources used by the RadComponentElement and optionally releases the unmanaged resources.
Declaration
protected override void DisposeManagedResources()
Overrides
Remarks
This method handles proper cleanup of design-time resources including removal of the component from the designer host when running in design mode. It ensures proper component lifecycle management in Visual Studio designer scenarios.
GetService(Type)
Gets a service object of the specified type from the component's site.
Declaration
protected virtual object GetService(Type service)
Parameters
service
The type of service to retrieve.
Returns
An object that implements the requested service, or null if the service cannot be resolved.
Remarks
This method provides access to design-time services when the component is sited in a designer. Common services include IDesignerHost, ITypeDescriptorContext, and other designer services.
OnPropertyChanged(RadPropertyChangedEventArgs)
Raises the PropertyChanged event and handles binding context updates.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
A RadPropertyChangedEventArgs that contains the event data.
Overrides
Remarks
This override ensures that data binding context changes are properly propagated to all associated data bindings when the BindingContextProperty changes.
ToString()
Returns a string representation of the RadComponentElement, including its site name if available.
Declaration
public override string ToString()
Returns
A string containing the site name and type name if the element has a site; otherwise, just the type name.
Overrides