ClassRadEditorControl
Provides an abstract base class for RadControls that support inline editing and advanced layout behaviors, particularly for controls hosted within TableLayoutPanel containers.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
public abstract class RadEditorControl : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadEditorControl
Derived Classes:
Implements:
Inherited Members
Constructors
RadEditorControl()
Declaration
protected RadEditorControl()
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
proposedSize
The custom-sized area for a control.
Returns
An ordered pair of type 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(int, int, int, int)
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
x
The x-coordinate for the sizing calculation.
y
The y-coordinate for the sizing calculation.
width
The width constraint for the sizing calculation.
height
The height constraint for the sizing calculation.
Returns
A 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 ParentChanged event and detects whether the control is hosted within a TableLayoutPanel.
Declaration
protected override void OnParentChanged(EventArgs e)
Parameters
e
An 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(int, int, int, int, 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
x
The new x-coordinate of the control.
y
The new y-coordinate of the control.
width
The new width of the control.
height
The new height of the control.
specified
A bitwise combination of 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.