ClassRadLayoutControl
Represents a container control that automatically arranges child controls in a consistent layout and scales their positioning as the control size changes. Provides runtime customization capabilities and layout serialization support.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[TelerikToolboxCategory("Containers")]
[Docking(DockingBehavior.Ask)]
public class RadLayoutControl : RadNCEnabledControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, IMessageFilter
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadNonClientUIControlRadNCEnabledControlRadLayoutControl
Implements:
Inherited Members
Constructors
RadLayoutControl()
Declaration
public RadLayoutControl()
Properties
AllowCustomize
Gets or sets a value indicating whether the end-user is allowed show the Customize Dialog and modify the existing layout.
Declaration
[Browsable(true)]
public bool AllowCustomize { get; set; }
Property Value
AllowHiddenItems
Gets or sets a value indicating whether the end-user is allowed to hide and show existing items.
Declaration
[Browsable(true)]
public bool AllowHiddenItems { get; set; }
Property Value
AllowResize
Gets or sets a value indicating whether resizing is enabled when the Customize Dialog is not shown.
Declaration
[Browsable(true)]
public bool AllowResize { get; set; }
Property Value
ClientMargin
Gets the margin around the client area of the control. In the default case, this should be the border thickness.
ContainerElement
Gets the main LayoutControlContainerElement which hosts the items on the root level.
Declaration
[Browsable(false)]
public LayoutControlContainerElement ContainerElement { get; }
Property Value
CreateParams
Declaration
protected override CreateParams CreateParams { get; }
Property Value
Overrides
CurrentResizingBehavior
If the user is currently resizing, returns the active LayoutControlResizingBehavior, otherwise returns null.
Declaration
public LayoutControlResizingBehavior CurrentResizingBehavior { get; }
Property Value
Cursor
Declaration
[Browsable(false)]
public override Cursor Cursor { get; set; }
Property Value
Overrides
CustomizeDialog
Gets or sets the Customize Dialog form which is shown via the context menu.
Declaration
[Browsable(false)]
public RadLayoutControlCustomizeDialog CustomizeDialog { get; set; }
Property Value
DefaultSize
Declaration
protected override Size DefaultSize { get; }
Property Value
Overrides
DragOverlay
Gets the LayoutControlDraggableOverlay control which appears when the Customize Dialog is shown.
Declaration
[Browsable(false)]
public LayoutControlDraggableOverlay DragOverlay { get; }
Property Value
DragOverlayVisible
Indicates whether the DragOverlay control is visible.
Declaration
[Browsable(false)]
public bool DragOverlayVisible { get; }
Property Value
DrawBorder
Gets or sets a value indicating whether the layout control displays its border.
Declaration
[Browsable(true)]
public bool DrawBorder { get; set; }
Property Value
true to draw the border; otherwise, false. The default value is true.
DropDownMenu
Gets or sets the context menu.
Declaration
[Browsable(false)]
public RadDropDownMenu DropDownMenu { get; set; }
Property Value
EnableNCModification
Declaration
protected override bool EnableNCModification { get; }
Property Value
Overrides
EnableNCPainting
Declaration
protected override bool EnableNCPainting { get; }
Property Value
Overrides
HiddenItems
Gets a collection containing the hidden items.
Declaration
[Browsable(false)]
public RadItemCollection HiddenItems { get; }
Property Value
HorizontalScrollbar
Gets the horizontal RadHScrollBar.
Declaration
[Browsable(false)]
public RadHScrollBar HorizontalScrollbar { get; }
Property Value
IsResizing
Indicates whether the user is currently resizing the items.
Items
Gets a collection containing the items on the root level.
Declaration
[Browsable(false)]
public RadItemOwnerCollection Items { get; }
Property Value
VerticalScrollbar
Gets the vertical RadVScrollBar.
Declaration
[Browsable(false)]
public RadVScrollBar VerticalScrollbar { get; }
Property Value
XmlSerializationInfo
Gets the serialization info for RadLayoutControl used by Save/Load layout methods to persist the layout to/from XML. By default or when set to null the ComponentXmlSerializationInfo provided by GetDefaultXmlSerializationInfo() will be used.
Declaration
[Browsable(false)]
public ComponentXmlSerializationInfo XmlSerializationInfo { get; set; }
Property Value
Methods
AddItem(Control, Control, LayoutControlDropPosition)
Adds a control at a specified position next to a specified control.
Declaration
public void AddItem(Control control, Control anchor, LayoutControlDropPosition position)
Parameters
control
The control to add.
anchor
An existing control next to which the new control will be added.
position
The position at which the new control will be added.
AddItem(Control, LayoutControlContainerElement)
Adds a control to the specified container.
Declaration
public void AddItem(Control control, LayoutControlContainerElement container)
Parameters
control
The control to add.
container
The container.
AddItem(Control, LayoutControlItemBase, LayoutControlDropPosition)
Adds a control at a specified position next to a specified item.
Declaration
public void AddItem(Control control, LayoutControlItemBase anchor, LayoutControlDropPosition position)
Parameters
control
The control to add.
anchor
An existing item next to which the new control will be added.
position
The position at which the new control will be added.
AddItem(LayoutControlItemBase)
Adds an item at the root level of the control and rebuilds the layout.
Declaration
public void AddItem(LayoutControlItemBase item)
Parameters
item
The item to add.
AddItem(LayoutControlItemBase, Control, LayoutControlDropPosition)
Adds an item at a specified position next to a specified existing control.
Declaration
public void AddItem(LayoutControlItemBase item, Control anchor, LayoutControlDropPosition position)
Parameters
item
The item to add.
anchor
An existing control next to which the new control will be added.
position
The position at which the new control will be added.
AddItem(LayoutControlItemBase, LayoutControlContainerElement)
Adds an item to the specified container and rebuilds its layout.
Declaration
public void AddItem(LayoutControlItemBase item, LayoutControlContainerElement container)
Parameters
item
The item to add.
container
The container to add the item to.
AddItem(LayoutControlItemBase, LayoutControlItemBase, LayoutControlDropPosition)
Adds an item at a specified position next to a specified existing item.
Declaration
public void AddItem(LayoutControlItemBase item, LayoutControlItemBase anchor, LayoutControlDropPosition position)
Parameters
item
The item to add.
anchor
An existing item next to which the new control will be added.
position
The position at which the new control will be added.
BeginInit()
Suspends layout during initialization.
Declaration
public override void BeginInit()
Overrides
BeginUpdate()
Puts the control in an initialization state where it will not update until EndUpdate is called.
Declaration
public void BeginUpdate()
CloseCustomizeDialog()
Closes the RadLayoutControlCustomizeDialog and puts the control out of customize mode.
Declaration
public void CloseCustomizeDialog()
CreateChildItems(RadElement)
Creates the child elements for the layout control including the container element and scrollbars.
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
parent
The parent element that will contain the child elements.
Overrides
CreateControlsInstance()
Declaration
protected override Control.ControlCollection CreateControlsInstance()
Returns
Overrides
Dispose(bool)
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
Overrides
EndUpdate()
Puts the control out of the initialization state caused by calling BeginUpdate and updates it.
Declaration
public void EndUpdate()
EnsureItemsControlsVisibility()
Called after load layout to ensure the visibility of the controls is the same as the visibility of the items.
Declaration
protected void EnsureItemsControlsVisibility()
FindItemByControl(Control)
Finds the item associated with a given control.
Declaration
public LayoutControlItem FindItemByControl(Control control)
Parameters
control
The control.
Returns
The control's associated item.
FindItemByControl(Control, bool)
Finds the item associated with a given control.
Declaration
public LayoutControlItem FindItemByControl(Control control, bool includeHidden)
Parameters
control
The control.
includeHidden
[true] if the HiddenItems collection should be searched, [false] otherwise.
Returns
The control's associated item.
GetAllItems()
Gets the items from all levels which are nested in the control.
Declaration
public IEnumerable<LayoutControlItemBase> GetAllItems()
Returns
IEnumerable<LayoutControlItemBase>
An enumeration of the items.
GetAllItems(bool)
Gets the items from all levels which are nested in the control.
Declaration
public IEnumerable<LayoutControlItemBase> GetAllItems(bool includeHidden)
Parameters
includeHidden
Returns
IEnumerable<LayoutControlItemBase>
GetBehaviorAtPoint(Point)
Gets the LayoutControlResizingBehavior that should be activated at a given point.
Declaration
public LayoutControlResizingBehavior GetBehaviorAtPoint(Point point)
Parameters
point
The point.
Returns
The resizing behavior at that point.
GetCursorAtPoint(Point)
Gets the mouse cursor which should be shown at a given point.
GetDefaultXmlSerializationInfo()
Gets the default serialization info for RadLayoutControl used by Save/Load layout methods to persist the layout to/from XML.
Declaration
protected virtual ComponentXmlSerializationInfo GetDefaultXmlSerializationInfo()
Returns
The default serialization info.
GetInitialCustomizeDialogLocation()
Gets the initial location of the RadLayoutControlCustomizeDialog.
Declaration
protected virtual Point GetInitialCustomizeDialogLocation()
Returns
The location.
HideDragOverlay()
Hides the LayoutControlDraggableOverlay.
Declaration
public void HideDragOverlay()
HideItem(Control)
Hides a control from the RadLayoutPanel and places it in the HiddenItems collection.
Declaration
public void HideItem(Control control)
Parameters
control
The control to hide.
HideItem(LayoutControlItemBase)
Hides an item from the RadLayoutPanel and places it in the HiddenItems collection.
Declaration
public void HideItem(LayoutControlItemBase item)
Parameters
item
The item to hide.
InitializeDropDownMenu()
Initializes the default context menu items for the layout control.
Declaration
protected virtual void InitializeDropDownMenu()
LoadLayout(Stream)
Loads RadLayoutControl's layout state from XML file, using the serialization information provided by the XmlSerializationInfo property.
Declaration
public virtual void LoadLayout(Stream stream)
Parameters
stream
The stream to read from.
LoadLayout(XmlReader)
Loads RadLayoutControl's layout state from XML file, using the serialization information provided by the XmlSerializationInfo property.
Declaration
public virtual void LoadLayout(XmlReader xmlReader)
Parameters
xmlReader
The XmlReader to read the XML from.
LoadLayout(string)
Loads RadLayoutControl's layout state from XML file, using the serialization information provided by the XmlSerializationInfo property.
Declaration
public virtual void LoadLayout(string fileName)
Parameters
fileName
The file to read from.
OnHandleCreated(EventArgs)
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
e
Overrides
OnHandleDestroyed(EventArgs)
Declaration
protected override void OnHandleDestroyed(EventArgs e)
Parameters
e
Overrides
OnHandleDropCompleted(object)
Declaration
protected virtual void OnHandleDropCompleted(object sender)
Parameters
sender
OnItemHiding(LayoutControlItemHidingEventArgs)
Raises the ItemHiding event when an item is about to be hidden.
Declaration
protected virtual void OnItemHiding(LayoutControlItemHidingEventArgs args)
Parameters
args
LayoutControlItemHidingEventArgs
The event arguments containing information about the item being hidden.
OnLayout(LayoutEventArgs)
Declaration
protected override void OnLayout(LayoutEventArgs e)
Parameters
e
Overrides
OnLoad(Size)
Notifies that the control is about to be visualized.
Declaration
protected override void OnLoad(Size desiredSize)
Parameters
desiredSize
Overrides
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
e
Overrides
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
e
Overrides
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
e
Overrides
OnMouseWheel(MouseEventArgs)
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
e
Overrides
OnNCPaint(Graphics)
Declaration
protected override void OnNCPaint(Graphics g)
Parameters
g
Overrides
OnPaint(PaintEventArgs)
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
e
Overrides
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
e
Overrides
OnStructureChanged(object)
Raises the StructureChanged event when the layout structure is modified.
Declaration
protected virtual void OnStructureChanged(object sender)
Parameters
sender
The source of the structure change.
OnThemeChanged()
Declaration
protected override void OnThemeChanged()
Overrides
RemoveItem(Control)
Removes the specified control from the RadLayoutControl.
Declaration
public void RemoveItem(Control control)
Parameters
control
The control to remove.
RemoveItem(LayoutControlItemBase)
Removes the specified item from the RadLayoutControl.
Declaration
public void RemoveItem(LayoutControlItemBase item)
Parameters
item
The item to remove.
ResetBackColorThemeOverrides()
Declaration
protected override void ResetBackColorThemeOverrides()
Overrides
ResetForeColorThemeOverrides()
Declaration
protected override void ResetForeColorThemeOverrides()
Overrides
ResizeItem(Control, int)
Resizes the specified control with a specified amount. Resize direction depends on the position of item.
ResizeItem(LayoutControlItemBase, int)
Resizes the specified item with a specified amount. Resize direction depends on the position of item.
Declaration
public void ResizeItem(LayoutControlItemBase item, int diff)
Parameters
item
The item to resize.
diff
The amount to resize with.
SaveLayout(Stream)
Stores RadLayoutControl's layout state in XML format, using the serialization information provided by the XmlSerializationInfo property.
Declaration
public virtual void SaveLayout(Stream stream)
Parameters
stream
The stream to write to.
SaveLayout(XmlWriter)
Stores RadLayoutControl's layout state in XML format, using the serialization information provided by the XmlSerializationInfo property.
Declaration
public virtual void SaveLayout(XmlWriter xmlWriter)
Parameters
xmlWriter
XmlWriter to use by the built-in serializer
SaveLayout(string)
Stores RadLayoutControl's layout state in XML format, using the serialization information provided by the XmlSerializationInfo property.
Declaration
public virtual void SaveLayout(string fileName)
Parameters
fileName
The file to write to.
SetBackColorThemeOverrides()
Declaration
protected override void SetBackColorThemeOverrides()
Overrides
SetForeColorThemeOverrides()
Declaration
protected override void SetForeColorThemeOverrides()
Overrides
ShowCustomizeDialog()
Shows the RadLayoutControlCustomizeDialog and puts the control in customize mode.
Declaration
public void ShowCustomizeDialog()
ShowDragOverlay()
Shows the LayoutControlDraggableOverlay control which allows reordering and resizing the items.
Declaration
public void ShowDragOverlay()
UpdateControlsLayout()
Updates the bounds of nested controls.
Declaration
public void UpdateControlsLayout()
UpdateScrollbars()
Updates the scrollbar metrics.
Declaration
public virtual void UpdateScrollbars()
Events
ItemHiding
Occurs when a layout control item is about to be hidden, allowing cancellation of the hiding operation.
Declaration
public event EventHandler<LayoutControlItemHidingEventArgs> ItemHiding
Event Value
StructureChanged
Occurs when the structure of the layout control changes, including modifications to items in the control or its inner containers such as groups and tabbed groups.