RadLayoutControl
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
public RadLayoutControl()
Properties
Gets or sets a value indicating whether the end-user is allowed show the Customize Dialog and modify the existing layout.
[Browsable(true)]
public bool AllowCustomize { get; set; }
Gets or sets a value indicating whether the end-user is allowed to hide and show existing items.
[Browsable(true)]
public bool AllowHiddenItems { get; set; }
Gets or sets a value indicating whether resizing is enabled when the Customize Dialog is not shown.
[Browsable(true)]
public bool AllowResize { get; set; }
Gets the margin around the client area of the control. In the default case, this should be the border thickness.
public Padding ClientMargin { get; }
Gets the main LayoutControlContainerElement which hosts the items on the root level.
[Browsable(false)]
public LayoutControlContainerElement ContainerElement { get; }
protected override CreateParams CreateParams { get; }
Overrides:
If the user is currently resizing, returns the active LayoutControlResizingBehavior, otherwise returns null.
public LayoutControlResizingBehavior CurrentResizingBehavior { get; }
Gets or sets the Customize Dialog form which is shown via the context menu.
[Browsable(false)]
public RadLayoutControlCustomizeDialog CustomizeDialog { get; set; }
protected override Size DefaultSize { get; }
Overrides:
Gets the LayoutControlDraggableOverlay control which appears when the Customize Dialog is shown.
[Browsable(false)]
public LayoutControlDraggableOverlay DragOverlay { get; }
Indicates whether the DragOverlay control is visible.
[Browsable(false)]
public bool DragOverlayVisible { get; }
Gets or sets a value indicating whether the layout control displays its border.
[Browsable(true)]
public bool DrawBorder { get; set; }
true to draw the border; otherwise, false. The default value is true.
Gets or sets the context menu.
[Browsable(false)]
public RadDropDownMenu DropDownMenu { get; set; }
protected override bool EnableNCModification { get; }
Overrides:
protected override bool EnableNCPainting { get; }
Overrides:
Gets a collection containing the hidden items.
[Browsable(false)]
public RadItemCollection HiddenItems { get; }
Gets the horizontal RadHScrollBar.
[Browsable(false)]
public RadHScrollBar HorizontalScrollbar { get; }
Indicates whether the user is currently resizing the items.
public bool IsResizing { get; }
Gets a collection containing the items on the root level.
[Browsable(false)]
public RadItemOwnerCollection Items { get; }
Gets the vertical RadVScrollBar.
[Browsable(false)]
public RadVScrollBar VerticalScrollbar { get; }
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.
[Browsable(false)]
public ComponentXmlSerializationInfo XmlSerializationInfo { get; set; }
Methods
Adds a control at a specified position next to a specified control.
public void AddItem(Control control, Control anchor, LayoutControlDropPosition position)
The control to add.
anchorControlAn existing control next to which the new control will be added.
positionLayoutControlDropPositionThe position at which the new control will be added.
Adds a control to the specified container.
public void AddItem(Control control, LayoutControlContainerElement container)
The control to add.
containerLayoutControlContainerElementThe container.
Adds a control at a specified position next to a specified item.
public void AddItem(Control control, LayoutControlItemBase anchor, LayoutControlDropPosition position)
The control to add.
anchorLayoutControlItemBaseAn existing item next to which the new control will be added.
positionLayoutControlDropPositionThe position at which the new control will be added.
Adds an item at a specified position next to a specified existing control.
public void AddItem(LayoutControlItemBase item, Control anchor, LayoutControlDropPosition position)
The item to add.
anchorControlAn existing control next to which the new control will be added.
positionLayoutControlDropPositionThe position at which the new control will be added.
Adds an item to the specified container and rebuilds its layout.
public void AddItem(LayoutControlItemBase item, LayoutControlContainerElement container)
The item to add.
containerLayoutControlContainerElementThe container to add the item to.
Adds an item at a specified position next to a specified existing item.
public void AddItem(LayoutControlItemBase item, LayoutControlItemBase anchor, LayoutControlDropPosition position)
The item to add.
anchorLayoutControlItemBaseAn existing item next to which the new control will be added.
positionLayoutControlDropPositionThe position at which the new control will be added.
Adds an item at the root level of the control and rebuilds the layout.
public void AddItem(LayoutControlItemBase item)
The item to add.
Suspends layout during initialization.
public override void BeginInit()
Overrides:
Puts the control in an initialization state where it will not update until EndUpdate is called.
public void BeginUpdate()
Closes the RadLayoutControlCustomizeDialog and puts the control out of customize mode.
public void CloseCustomizeDialog()
Creates the child elements for the layout control including the container element and scrollbars.
protected override void CreateChildItems(RadElement parent)
The parent element that will contain the child elements.
Overrides:
protected override Control.ControlCollection CreateControlsInstance()
Overrides:
Resumes layout.
public override void EndInit()
Overrides:
Puts the control out of the initialization state caused by calling BeginUpdate and updates it.
public void EndUpdate()
Called after load layout to ensure the visibility of the controls is the same as the visibility of the items.
protected void EnsureItemsControlsVisibility()
Finds the item associated with a given control.
public LayoutControlItem FindItemByControl(Control control)
The control.
Returns:The control's associated item.
Gets the items from all levels which are nested in the control.
public IEnumerable<LayoutControlItemBase> GetAllItems()
IEnumerable<LayoutControlItemBase>
An enumeration of the items.
Gets the items from all levels which are nested in the control.
public IEnumerable<LayoutControlItemBase> GetAllItems(bool includeHidden)
IEnumerable<LayoutControlItemBase>
Gets the LayoutControlResizingBehavior that should be activated at a given point.
public LayoutControlResizingBehavior GetBehaviorAtPoint(Point point)
The point.
Returns:The resizing behavior at that point.
Gets the default serialization info for RadLayoutControl used by Save/Load layout methods to persist the layout to/from XML.
protected virtual ComponentXmlSerializationInfo GetDefaultXmlSerializationInfo()
The default serialization info.
Gets the initial location of the RadLayoutControlCustomizeDialog.
Hides the LayoutControlDraggableOverlay.
public void HideDragOverlay()
Hides a control from the RadLayoutPanel and places it in the HiddenItems collection.
Hides an item from the RadLayoutPanel and places it in the HiddenItems collection.
public void HideItem(LayoutControlItemBase item)
The item to hide.
Initializes the default context menu items for the layout control.
protected virtual void InitializeDropDownMenu()
Loads RadLayoutControl's layout state from XML file, using the serialization information provided by the XmlSerializationInfo property.
Loads RadLayoutControl's layout state from XML file, using the serialization information provided by the XmlSerializationInfo property.
Loads RadLayoutControl's layout state from XML file, using the serialization information provided by the XmlSerializationInfo property.
public virtual void LoadLayout(XmlReader xmlReader)
The XmlReader to read the XML from.
Raises the ItemHiding event when an item is about to be hidden.
protected virtual void OnItemHiding(LayoutControlItemHidingEventArgs args)
The event arguments containing information about the item being hidden.
Notifies that the control is about to be visualized.
Raises the StructureChanged event when the layout structure is modified.
protected virtual void OnStructureChanged(object sender)
The source of the structure change.
protected override void OnThemeChanged()
Overrides:
Removes the specified control from the RadLayoutControl.
Removes the specified item from the RadLayoutControl.
public void RemoveItem(LayoutControlItemBase item)
The item to remove.
protected override void ResetBackColorThemeOverrides()
Overrides:
protected override void ResetForeColorThemeOverrides()
Overrides:
Resizes the specified item with a specified amount. Resize direction depends on the position of item.
public void ResizeItem(LayoutControlItemBase item, int diff)
The item to resize.
diffintThe amount to resize with.
Stores RadLayoutControl's layout state in XML format, using the serialization information provided by the XmlSerializationInfo property.
Stores RadLayoutControl's layout state in XML format, using the serialization information provided by the XmlSerializationInfo property.
Stores RadLayoutControl's layout state in XML format, using the serialization information provided by the XmlSerializationInfo property.
public virtual void SaveLayout(XmlWriter xmlWriter)
XmlWriter to use by the built-in serializer
protected override void SetBackColorThemeOverrides()
Overrides:
protected override void SetForeColorThemeOverrides()
Overrides:
Shows the RadLayoutControlCustomizeDialog and puts the control in customize mode.
public void ShowCustomizeDialog()
Shows the LayoutControlDraggableOverlay control which allows reordering and resizing the items.
public void ShowDragOverlay()
Updates the bounds of nested controls.
public void UpdateControlsLayout()
Updates the scrollbar metrics.
public virtual void UpdateScrollbars()
Events
Occurs when a layout control item is about to be hidden, allowing cancellation of the hiding operation.
public event EventHandler<LayoutControlItemHidingEventArgs> ItemHiding
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.
public event EventHandler StructureChanged