Class RadLayoutControl
A container control which keeps its child controls arranged in a consistent way and scales their layout as the control size changes. Allows runtime customization and serializing the layout.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[TelerikToolboxCategory("Containers")]
public class RadLayoutControl : RadNCEnabledControl, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider, IMessageFilter
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
public bool AllowCustomize { get; set; }
Property Value
System.Boolean
|
AllowHiddenItems
Gets or sets a value indicating whether the end-user is allowed to hide and show existing items.
Declaration
public bool AllowHiddenItems { get; set; }
Property Value
System.Boolean
|
AllowResize
Gets or sets a value indicating whether resizing is enabled when the Customize Dialog is not shown.
Declaration
public bool AllowResize { get; set; }
Property Value
System.Boolean
|
ClientMargin
Gets the margin around the client area of the control. In the default case, this should be the border thickness.
Declaration
public Padding ClientMargin { get; }
Property Value
System.Windows.Forms.Padding
|
ContainerElement
Gets the main LayoutControlContainerElement which hosts the items on the root level.
Declaration
public LayoutControlContainerElement ContainerElement { get; }
Property Value
LayoutControlContainerElement
|
CreateParams
Declaration
protected override CreateParams CreateParams { get; }
Property Value
System.Windows.Forms.CreateParams
|
CurrentResizingBehavior
If the user is currently resizing, returns the active LayoutControlResizingBehavior, otherwise returns null.
Declaration
public LayoutControlResizingBehavior CurrentResizingBehavior { get; }
Property Value
LayoutControlResizingBehavior
|
Cursor
Declaration
public override Cursor Cursor { get; set; }
Property Value
System.Windows.Forms.Cursor
|
CustomizeDialog
Gets or sets the Customize Dialog form which is shown via the context menu.
Declaration
public RadLayoutControlCustomizeDialog CustomizeDialog { get; set; }
Property Value
RadLayoutControlCustomizeDialog
|
DefaultSize
Declaration
protected override Size DefaultSize { get; }
Property Value
System.Drawing.Size
|
DragOverlay
Gets the LayoutControlDraggableOverlay control which appears when the Customize Dialog is shown.
Declaration
public LayoutControlDraggableOverlay DragOverlay { get; }
Property Value
LayoutControlDraggableOverlay
|
DragOverlayVisible
Indicates whether the DragOverlay control is visible.
Declaration
public bool DragOverlayVisible { get; }
Property Value
System.Boolean
|
DrawBorder
Gets or sets a value indicating whether the control should draw its border.
Declaration
public bool DrawBorder { get; set; }
Property Value
System.Boolean
|
DropDownMenu
Gets or sets the context menu.
Declaration
public RadDropDownMenu DropDownMenu { get; set; }
Property Value
RadDropDownMenu
|
EnableNCModification
Declaration
protected override bool EnableNCModification { get; }
Property Value
System.Boolean
|
Overrides
EnableNCPainting
Declaration
protected override bool EnableNCPainting { get; }
Property Value
System.Boolean
|
Overrides
HiddenItems
Gets a collection containing the hidden items.
Declaration
public RadItemCollection HiddenItems { get; }
Property Value
RadItemCollection
|
HorizontalScrollbar
Gets the horizontal RadHScrollBar.
Declaration
public RadHScrollBar HorizontalScrollbar { get; }
Property Value
RadHScrollBar
|
IsResizing
Indicates whether the user is currently resizing the items.
Declaration
public bool IsResizing { get; }
Property Value
System.Boolean
|
Items
Gets a collection containing the items on the root level.
Declaration
public RadItemOwnerCollection Items { get; }
Property Value
RadItemOwnerCollection
|
Text
This property is not relevant for this class.
Declaration
public override string Text { get; set; }
Property Value
System.String
|
Overrides
VerticalScrollbar
Gets the vertical RadVScrollBar.
Declaration
public RadVScrollBar VerticalScrollbar { get; }
Property Value
RadVScrollBar
|
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
public ComponentXmlSerializationInfo XmlSerializationInfo { get; set; }
Property Value
ComponentXmlSerializationInfo
|
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
System.Windows.Forms.Control
control
The control to add. |
System.Windows.Forms.Control
anchor
An existing control next to which the new control will be added. |
LayoutControlDropPosition
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
System.Windows.Forms.Control
control
The control to add. |
LayoutControlContainerElement
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
System.Windows.Forms.Control
control
The control to add. |
LayoutControlItemBase
anchor
An existing item next to which the new control will be added. |
LayoutControlDropPosition
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
LayoutControlItemBase
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
LayoutControlItemBase
item
The item to add. |
System.Windows.Forms.Control
anchor
An existing control next to which the new control will be added. |
LayoutControlDropPosition
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
LayoutControlItemBase
item
The item to add. |
LayoutControlContainerElement
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
LayoutControlItemBase
item
The item to add. |
LayoutControlItemBase
anchor
An existing item next to which the new control will be added. |
LayoutControlDropPosition
position
The position at which the new control will be added. |
BeginInit()
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)
Declaration
protected override void CreateChildItems(RadElement parent)
Parameters
RadElement
parent
|
Overrides
CreateControlsInstance()
Declaration
protected override Control.ControlCollection CreateControlsInstance()
Returns
System.Windows.Forms.Control.ControlCollection
|
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
System.Boolean
disposing
|
Overrides
EndInit()
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
System.Windows.Forms.Control
control
The control. |
Returns
LayoutControlItem
The control's associated item. |
FindItemByControl(Control, Boolean)
Finds the item associated with a given control.
Declaration
public LayoutControlItem FindItemByControl(Control control, bool includeHidden)
Parameters
System.Windows.Forms.Control
control
The control. |
System.Boolean
includeHidden
[true] if the HiddenItems collection should be searched, [false] otherwise. |
Returns
LayoutControlItem
The control's associated item. |
GetAllItems()
Gets the items from all levels which are nested in the control.
Declaration
public IEnumerable<LayoutControlItemBase> GetAllItems()
Returns
System.Collections.Generic.IEnumerable<LayoutControlItemBase>
An enumeration of the items. |
GetAllItems(Boolean)
Gets the items from all levels which are nested in the control.
Declaration
public IEnumerable<LayoutControlItemBase> GetAllItems(bool includeHidden)
Parameters
System.Boolean
includeHidden
|
Returns
System.Collections.Generic.IEnumerable<LayoutControlItemBase>
|
GetBehaviorAtPoint(Point)
Gets the LayoutControlResizingBehavior that should be activated at a given point.
Declaration
public LayoutControlResizingBehavior GetBehaviorAtPoint(Point point)
Parameters
System.Drawing.Point
point
The point. |
Returns
LayoutControlResizingBehavior
The resizing behavior at that point. |
GetCursorAtPoint(Point)
Gets the mouse cursor which should be shown at a given point.
Declaration
public Cursor GetCursorAtPoint(Point point)
Parameters
System.Drawing.Point
point
The point. |
Returns
System.Windows.Forms.Cursor
The cursor to be shown at that 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
ComponentXmlSerializationInfo
The default serialization info. |
GetInitialCustomizeDialogLocation()
Gets the initial location of the RadLayoutControlCustomizeDialog.
Declaration
protected virtual Point GetInitialCustomizeDialogLocation()
Returns
System.Drawing.Point
The location. |
GetNCMetrics()
Declaration
protected override Padding GetNCMetrics()
Returns
System.Windows.Forms.Padding
|
Overrides
HideDragOverlay()
HideItem(Control)
Hides a control from the RadLayoutPanel and places it in the HiddenItems collection.
Declaration
public void HideItem(Control control)
Parameters
System.Windows.Forms.Control
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
LayoutControlItemBase
item
The item to hide. |
InitializeDropDownMenu()
Initializes the items of the default context menu.
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
System.IO.Stream
stream
The stream to read 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
System.String
fileName
The file 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
System.Xml.XmlReader
xmlReader
The XmlReader to read the XML from. |
OnHandleCreated(EventArgs)
Declaration
protected override void OnHandleCreated(EventArgs e)
Parameters
System.EventArgs
e
|
OnHandleDestroyed(EventArgs)
Declaration
protected override void OnHandleDestroyed(EventArgs e)
Parameters
System.EventArgs
e
|
Overrides
OnHandleDropCompleted(Object)
Declaration
protected virtual void OnHandleDropCompleted(object sender)
Parameters
System.Object
sender
|
OnItemHiding(LayoutControlItemHidingEventArgs)
Declaration
protected virtual void OnItemHiding(LayoutControlItemHidingEventArgs args)
Parameters
LayoutControlItemHidingEventArgs
args
|
OnLayout(LayoutEventArgs)
Declaration
protected override void OnLayout(LayoutEventArgs e)
Parameters
System.Windows.Forms.LayoutEventArgs
e
|
Overrides
OnLoad(Size)
Declaration
protected override void OnLoad(Size desiredSize)
Parameters
System.Drawing.Size
desiredSize
|
Overrides
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnMouseWheel(MouseEventArgs)
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnNCPaint(Graphics)
Declaration
protected override void OnNCPaint(Graphics g)
Parameters
System.Drawing.Graphics
g
|
Overrides
OnPaint(PaintEventArgs)
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
System.Windows.Forms.PaintEventArgs
e
|
Overrides
OnSizeChanged(EventArgs)
Declaration
protected override void OnSizeChanged(EventArgs e)
Parameters
System.EventArgs
e
|
OnStructureChanged(Object)
Declaration
protected virtual void OnStructureChanged(object sender)
Parameters
System.Object
sender
|
OnThemeChanged()
PreFilterMessage(ref Message)
Declaration
public bool PreFilterMessage(ref Message m)
Parameters
System.Windows.Forms.Message
m
|
Returns
System.Boolean
|
ProcessCmdKey(ref Message, Keys)
Declaration
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
Parameters
System.Windows.Forms.Message
msg
|
System.Windows.Forms.Keys
keyData
|
Returns
System.Boolean
|
RemoveItem(Control)
Removes the specified control from the RadLayoutControl.
Declaration
public void RemoveItem(Control control)
Parameters
System.Windows.Forms.Control
control
The control to remove. |
RemoveItem(LayoutControlItemBase)
Removes the specified item from the RadLayoutControl.
Declaration
public void RemoveItem(LayoutControlItemBase item)
Parameters
LayoutControlItemBase
item
The item to remove. |
ResetBackColorThemeOverrides()
Declaration
protected override void ResetBackColorThemeOverrides()
Overrides
ResetForeColorThemeOverrides()
Declaration
protected override void ResetForeColorThemeOverrides()
Overrides
ResizeItem(Control, Int32)
Resizes the specified control with a specified amount. Resize direction depends on the position of item.
Declaration
public void ResizeItem(Control control, int diff)
Parameters
System.Windows.Forms.Control
control
The control to resize. |
System.Int32
diff
The amount to resize with. |
ResizeItem(LayoutControlItemBase, Int32)
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
LayoutControlItemBase
item
The item to resize. |
System.Int32
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
System.IO.Stream
stream
The stream to write to. |
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
System.String
fileName
The file 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
System.Xml.XmlWriter
xmlWriter
XmlWriter to use by the built-in serializer |
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
Fired when the items of the control or the items of the inner containers (such as groups and tabbed groups) have changed.
Declaration
public event EventHandler<LayoutControlItemHidingEventArgs> ItemHiding
Event Type
System.EventHandler<LayoutControlItemHidingEventArgs>
|
StructureChanged
Fired when the items of the control or the items of the inner containers (such as groups and tabbed groups) have changed.
Declaration
public event EventHandler StructureChanged
Event Type
System.EventHandler
|