Class RadEditorControl
Provides an abstract base class for RadControls that support inline editing and advanced layout behaviors, particularly for controls hosted within TableLayoutPanel containers.
Inherited Members
Namespace: Telerik.WinControls
Assembly: Telerik.WinControls.dll
Syntax
public abstract class RadEditorControl : RadControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider
Remarks
RadEditorControl extends RadControl to provide specialized behavior for controls that may be used as editors or within complex layout scenarios. It includes enhanced support for TableLayoutPanel integration, ensuring proper sizing and layout behavior in constrained environments.
The class automatically detects when it's hosted within a TableLayoutPanel and adjusts its sizing behavior accordingly, handling edge cases such as minimized forms and constrained sizing scenarios that can occur in complex layout arrangements.
This abstract class serves as the foundation for various RadControl editors and input controls that require sophisticated layout management and container integration capabilities.
Constructors
RadEditorControl()
Declaration
protected RadEditorControl()
Properties
ImageList
Gets or sets the ImageList associated with this control.
Declaration
public override ImageList ImageList { get; set; }
Property Value
System.Windows.Forms.ImageList
An ImageList that contains the images for this control. This property is not typically used in RadEditorControl implementations. |
Overrides
Remarks
This property is inherited from the base RadControl class but is hidden from the designer and IntelliSense for RadEditorControl implementations, as image lists are typically managed at the element level rather than the control level for editor controls.
Methods
GetPreferredSize(Size)
Retrieves the size of a rectangular area into which a control can be fitted, with special handling for TableLayoutPanel scenarios.
Declaration
public override Size GetPreferredSize(Size proposedSize)
Parameters
System.Drawing.Size
proposedSize
The custom-sized area for a control. |
Returns
System.Drawing.Size
An ordered pair of type System.Drawing.Size representing the width and height of a rectangle. |
Overrides
Remarks
When the control is hosted within a TableLayoutPanel, this method provides enhanced handling for edge cases where the proposed size has extremely small dimensions (1 pixel or less). In such cases, it requests the preferred size with maximum dimensions to ensure proper sizing calculations.
This specialized behavior prevents sizing issues that can occur in TableLayoutPanel scenarios, particularly when controls are being measured during complex layout operations or when forms are minimized.
GetRootElementDesiredSize(Int32, Int32, Int32, Int32)
Calculates the desired size of the root element with enhanced TableLayoutPanel support.
Declaration
protected override Size GetRootElementDesiredSize(int x, int y, int width, int height)
Parameters
System.Int32
x
The x-coordinate for the sizing calculation. |
System.Int32
y
The y-coordinate for the sizing calculation. |
System.Int32
width
The width constraint for the sizing calculation. |
System.Int32
height
The height constraint for the sizing calculation. |
Returns
System.Drawing.Size
A System.Drawing.Size structure containing the desired dimensions of the root element. |
Overrides
Remarks
This method provides specialized sizing behavior when the control is hosted within a TableLayoutPanel. When extremely small dimensions (1 pixel or less) are provided as constraints, the method automatically adjusts the measurement parameters to use maximum values, ensuring accurate size calculations.
The method also includes fallback logic to use the control's current dimensions when the calculated size is invalid or when maximum values are returned, preventing sizing anomalies in complex layout scenarios.
OnParentChanged(EventArgs)
Raises the System.Windows.Forms.Control.ParentChanged event and detects whether the control is hosted within a TableLayoutPanel.
Declaration
protected override void OnParentChanged(EventArgs e)
Parameters
System.EventArgs
e
An System.EventArgs that contains the event data. |
Overrides
Remarks
This method automatically detects when the control is placed within a TableLayoutPanel container and adjusts internal behavior to handle specialized sizing and layout requirements.
SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified)
Sets the specified bounds of the control with special handling for TableLayoutPanel and minimized form scenarios.
Declaration
protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
Parameters
System.Int32
x
The new x-coordinate of the control. |
System.Int32
y
The new y-coordinate of the control. |
System.Int32
width
The new width of the control. |
System.Int32
height
The new height of the control. |
System.Windows.Forms.BoundsSpecified
specified
A bitwise combination of System.Windows.Forms.BoundsSpecified values. |
Overrides
Remarks
This method provides enhanced handling for controls hosted within TableLayoutPanel containers, particularly when the parent form is minimized. It prevents unwanted width changes when the root element is configured to stretch horizontally, maintaining visual consistency during form state transitions.
The method checks for minimized form states and preserves the current width when horizontal stretching is enabled, preventing layout anomalies that can occur during form minimization and restoration cycles.