New to Telerik UI for WinFormsStart a free 30-day trial

An extension of the RadLayoutControl which adds data binding functionality. When set with a DataSource, RadDataLayout automatically generates editors for each of the fields in the datasource. Provides validation functionality and additional interface for displaying validation messages.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
[TelerikToolboxCategory("Editors")]
[Docking(DockingBehavior.Ask)]
public class RadDataLayout : RadNCEnabledControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, ISmartPasteButtonProvider

Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadNonClientUIControlRadNCEnabledControlRadDataLayout...

Implements: IAnalyticsProviderIBindableComponentIComponentIComponentTreeHandlerIDisposableIDropTargetILayoutHandlerINotifyPropertyChangedISmartPasteButtonProviderISupportInitializeISupportInitializeNotificationISynchronizeInvokeIWin32Window...

Inherited Members RadNCEnabledControl.WndProc(ref Message)RadNCEnabledControl.WmNCHitTest(ref Message)RadNCEnabledControl.IconCaptionElementRadNCEnabledControl.MinimizeButtonElementRadNCEnabledControl.MaximizeButtonElementRadNCEnabledControl.HelpButtonElementRadNCEnabledControl.SystemButtonsElementRadNCEnabledControl.TextCaptionElementRadControl.isResizing2RadControl.isDisposing2RadControl.invalidResizeRectRadControl.isAccessibilityRequestedRadControl.Construct()RadControl.CreateBehavior()RadControl.CreateRootElement()RadControl.InitializeRootElement(RootRadElement)RadControl.LoadElementTree()RadControl.LoadElementTree(Size)RadControl.OnKeyDown(KeyEventArgs)RadControl.OnKeyUp(KeyEventArgs)RadControl.OnPreviewKeyDown(PreviewKeyDownEventArgs)RadControl.OnKeyPress(KeyPressEventArgs)RadControl.OnClick(EventArgs)RadControl.OnDoubleClick(EventArgs)RadControl.OnMouseDown(MouseEventArgs)RadControl.OnMouseUp(MouseEventArgs)RadControl.OnMouseEnter(EventArgs)RadControl.OnMouseLeave(EventArgs)RadControl.OnMouseMove(MouseEventArgs)RadControl.OnMouseHover(EventArgs)RadControl.OnMouseWheel(MouseEventArgs)RadControl.OnMouseCaptureChanged(EventArgs)RadControl.OnGotFocus(EventArgs)RadControl.OnLostFocus(EventArgs)RadControl.OnCreateControl()RadControl.OnHandleDestroyed(EventArgs)RadControl.OnParentChanged(EventArgs)RadControl.OnVisibleChanged(EventArgs)RadControl.OnFontChanged(EventArgs)RadControl.OnForeColorChanged(EventArgs)RadControl.OnBackColorChanged(EventArgs)RadControl.OnEnabledChanged(EventArgs)RadControl.OnLocationChanged(EventArgs)RadControl.OnPaddingChanged(EventArgs)RadControl.OnRightToLeftChanged(EventArgs)RadControl.OnPaint(PaintEventArgs)RadControl.OnLayout(LayoutEventArgs)RadControl.OnAutoSizeChanged(EventArgs)RadControl.OnInvalidated(RadElement)RadControl.OnLoad(Size)RadControl.OnCaptureLosing()RadControl.OnToolTipTextNeeded(object, ToolTipTextNeededEventArgs)RadControl.OnScreenTipNeeded(object, ScreenTipNeededEventArgs)RadControl.OnThemeNameChanged(ThemeNameChangedEventArgs)RadControl.ProcessMnemonic(char)RadControl.ProcessFocusRequested(RadElement)RadControl.ProcessCaptureChangeRequested(RadElement, bool)RadControl.ProcessAutoSizeChanged(bool)RadControl.IsInputKey(Keys)RadControl.GetInputElement()RadControl.BeginInit()RadControl.OnNotifyPropertyChanged(string)RadControl.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadControl.GetPreferredSize(Size)RadControl.SetBoundsCore(int, int, int, int, BoundsSpecified)RadControl.GetRootElementDesiredSize(int, int, int, int)RadControl.OnZoomGesture(ZoomGestureEventArgs)RadControl.OnRotateGesture(RotateGestureEventArgs)RadControl.OnPanGesture(PanGestureEventArgs)RadControl.OnTwoFingerTapGesture(GestureEventArgs)RadControl.OnPressAndTapGesture(PressAndTapGestureEventArgs)RadControl.OnGesture(GestureEventArgs)RadControl.ProcessGesture(Message)RadControl.EnableGesture(GestureType)RadControl.DisableGesture(GestureType)RadControl.Refresh()RadControl.SuspendUpdate()RadControl.ResumeUpdate()RadControl.ResumeUpdate(bool)RadControl.InvokeLayoutCallback(LayoutCallback)RadControl.RegisterHostedControl(RadHostItem)RadControl.UnregisterHostedControl(RadHostItem, bool)RadControl.ResolveStyleGroupForElement(StyleGroup, RadObject)RadControl.GetPlainText()RadControl.ShouldSerializeProperty(RadProperty)RadControl.ShouldSerializeProperty(RadProperty, RadObject)RadControl.ResetProperty(RadProperty, RadObject)RadControl.CanEditElementAtDesignTime(RadElement)RadControl.ProcessCodedUIMessage(ref IPCMessage)RadControl.FindPropertyInChildren(RadControl, IPCMessage)RadControl.ScaleControl(SizeF, BoundsSpecified)RadControl.PerformRadAutoScale(BoundsSpecified?)RadControl.GetMonitorDpiScaleFactor(Control)RadControl.SetRadAutoScale(bool)RadControl.EnableDpiScalingRadControl.EnableRadAutoScaleRadControl.EnableRadFormInitialDpiScalingRadControl.EnableImageDpiScalingRadControl.EnableSvgImagesRadControl.IsLoadedRadControl.ElementTreeRadControl.UseCompatibleTextRenderingDefaultValueRadControl.BehaviorRadControl.RootElementRadControl.PaddingRadControl.ThemeNameRadControl.TextRadControl.EnableThemingRadControl.ThemeClassNameRadControl.ImageListRadControl.ImageScalingSizeRadControl.UseCompatibleTextRenderingRadControl.AutoSizeRadControl.MaximumSizeRadControl.MinimumSizeRadControl.FocusableRadControl.SiteRadControl.CausesValidationRadControl.IsInitializingRadControl.SmallImageListRadControl.SmallImageScalingSizeRadControl.IsDesignModeRadControl.IsDisplayedRadControl.FocusedElementRadControl.AllowShowFocusCuesRadControl.ShowItemToolTipsRadControl.CommandBindingsRadControl.EnableKeyMapRadControl.BackColorRadControl.ForeColorRadControl.FontRadControl.ValidationCancelRadControl.EnableAnalyticsRadControl.AnalyticsNameRadControl.EnableRadAccessibilityObjectsRadControl.EnableCodedUITestsRadControl.EnableCodedUITestsDefaultValueRadControl.EnableUIAutomationRadControl.EnableUIAutomationDefaultValueRadControl.ElementInvalidatedRadControl.ToolTipTextNeededRadControl.ScreenTipNeededRadControl.ThemeNameChangedRadControl.InitializedRadControl.PropertyChangedRadControl.ZoomGestureRadControl.RotateGestureRadControl.PanGestureRadControl.TwoFingerTapGestureRadControl.PressAndTapGesture...

Constructors

Initializes a new instance of the RadDataLayout class.

C#
public RadDataLayout()

Properties

If [true], the labels will have a fixed size, best-fitted to the largest text in the column. If [false], the labels will have their default proportional size.

C#
[Browsable(true)]
public bool AutoSizeLabels { get; set; }

Gets the margin around the client area of the control. In the default case, this should be the border thickness.

C#
public Padding ClientMargin { get; }

Gets or sets the number of columns which will be used to arrange generated controls.

C#
[Browsable(true)]
public int ColumnCount { get; set; }
Exceptions:

ArgumentException

Number Of Columns should be at least one

Gets the current object.

C#
[Browsable(false)]
public object CurrentObject { get; }

Gets the instance of RadDataLayoutElement which is the main element in the hierarchy tree and encapsulates the actual functionality of RadDataLayout.

C#
[Browsable(false)]
public RadDataLayoutElement DataLayoutElement { get; }

Gets or sets the DataSource. Setting the DataSource will auto-generate editors for the fields in it.

C#
[Browsable(true)]
public object DataSource { get; set; }

Gets the default size of the RadDataLayout control.

C#
protected override Size DefaultSize { get; }

Overrides: Control.DefaultSize

Gets a value indicating whether non-client modification is enabled for this control.

C#
protected override bool EnableNCModification { get; }

Overrides: RadNCEnabledControl.EnableNCModification

Gets a value indicating whether non-client painting is enabled for this control.

C#
protected override bool EnableNCPainting { get; }

Overrides: RadNCEnabledControl.EnableNCPainting

Gets or sets a value indicating the flow direction of generated editors when the ColumnCount property has value bigger than 1.

C#
[Browsable(true)]
public FlowDirection FlowDirection { get; set; }

The ItemDefaultHeight property sets the height that generated items should have.

C#
[Browsable(true)]
public int ItemDefaultHeight { get; set; }

Gets the inner RadLayoutControl.

C#
[Browsable(true)]
public RadLayoutControl LayoutControl { get; }

Gets the BindingManagerBase manager that is used to manage the current DataSource.

C#
[Browsable(false)]
public BindingManagerBase Manager { get; }

Gets or sets a value indicating whether the validation panel should appear.

C#
[Browsable(false)]
public bool ShowValidationPanel { get; set; }

Gets the validation panel.

C#
[Browsable(true)]
public ValidationPanel ValidationPanel { get; }

Methods

Creates child elements for the RadDataLayout control.

C#
protected override void CreateChildItems(RadElement parent)
Parameters:parentRadElement

The parent element.

Overrides: RadControl.CreateChildItems(RadElement)

Releases the unmanaged resources used by the RadDataLayout and optionally releases the managed resources.

C#
protected override void Dispose(bool disposing)
Parameters:disposingbool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Overrides: RadControl.Dispose(bool)

Completes the initialization of the component and performs binding if necessary.

C#
public override void EndInit()

Overrides: RadControl.EndInit()

Returns the generated bound editors as smart paste fields.

C#
public IEnumerable<SmartPasteButtonField> GetFields()
Returns:

IEnumerable<SmartPasteButtonField>

A collection of smart paste field descriptors.

Implements: ISmartPasteButtonProvider.GetFields()

Gets the non-client area metrics for the control.

C#
protected override Padding GetNCMetrics()
Returns:

Padding

A Padding structure representing the border thickness.

Overrides: RadNCEnabledControl.GetNCMetrics()

Initializes the RadLayoutControl and the ValidationPanel

C#
protected virtual void InitializeInternalControls()

Raises the BindingContextChanged event.

C#
protected override void OnBindingContextChanged(EventArgs e)
Parameters:eEventArgs

An EventArgs that contains the event data.

Overrides: RadControl.OnBindingContextChanged(EventArgs)

Fires the BindingCreated event.

C#
protected virtual void OnBindingCreated(object sender, BindingCreatedEventArgs e)
Parameters:senderobject

The sender.

eBindingCreatedEventArgs

The BindingCreatedEventArgs instance containing the event data.

Fires the BindingCreating event.

C#
protected virtual void OnBindingCreating(object sender, BindingCreatingEventArgs e)
Parameters:senderobject

The sender.

eBindingCreatingEventArgs

The BindingCreatingEventArgs instance containing the event data.

Fires the EditorInitialized event.

C#
protected virtual void OnEditorInitialized(object sender, EditorInitializedEventArgs e)
Parameters:senderobject

The sender.

eEditorInitializedEventArgs

The EditorInitializedEventArgs instance containing the event data.

Fires the EditorInitializing event.

C#
protected virtual void OnEditorInitializing(object sender, EditorInitializingEventArgs e)
Parameters:senderobject

The sender.

eEditorInitializingEventArgs

The EditorInitializingEventArgs instance containing the event data.

Fires the ItemInitialized event.

C#
protected virtual void OnItemInitialized(object sender, DataLayoutItemInitializedEventArgs e)
Parameters:senderobject

The sender.

eDataLayoutItemInitializedEventArgs

The DataLayoutItemInitializedEventArgs instance containing the event data.

Fires the ItemInitializing event.

C#
protected virtual void OnItemInitializing(object sender, DataLayoutItemInitializingEventArgs e)
Parameters:senderobject

The sender.

eDataLayoutItemInitializingEventArgs

The DataLayoutItemInitializingEventArgs instance containing the event data.

Fires the ItemValidated event.

C#
protected virtual void OnItemValidated(object sender, DataLayoutItemValidatedEventArgs e)
Parameters:senderobject

The sender.

eDataLayoutItemValidatedEventArgs

The DataLayoutItemValidatedEventArgs instance containing the event data.

Fires the ItemValidating event.

C#
protected virtual void OnItemValidating(object sender, DataLayoutItemValidatingEventArgs e)
Parameters:senderobject

The sender.

eDataLayoutItemValidatingEventArgs

The DataLayoutItemValidatingEventArgs instance containing the event data.

Performs custom painting of the non-client area.

C#
protected override void OnNCPaint(Graphics g)
Parameters:gGraphics

The Graphics object used for painting.

Overrides: RadNCEnabledControl.OnNCPaint(Graphics)

Raises the SizeChanged event and invalidates the non-client area.

C#
protected override void OnSizeChanged(EventArgs e)
Parameters:eEventArgs

An EventArgs that contains the event data.

Overrides: Control.OnSizeChanged(EventArgs)

Raises the ThemeChanged event and updates theme-related properties.

C#
protected override void OnThemeChanged()

Overrides: RadControl.OnThemeChanged()

Resets the background color theme overrides for this control and its internal layout control.

C#
protected override void ResetBackColorThemeOverrides()

Overrides: RadControl.ResetBackColorThemeOverrides()

Resets the foreground color theme overrides for this control and its internal layout control.

C#
protected override void ResetForeColorThemeOverrides()

Overrides: RadControl.ResetForeColorThemeOverrides()

Sets the background color theme overrides for this control and its internal layout control.

C#
protected override void SetBackColorThemeOverrides()

Overrides: RadControl.SetBackColorThemeOverrides()

Sets the value of a generated editor bound to the specified field.

C#
public void SetFieldValue(string field, object value)
Parameters:fieldstring

The bound field name.

valueobject

The value to assign.

Implements: ISmartPasteButtonProvider.SetFieldValue(string, object)

Sets the foreground color theme overrides for this control and its internal layout control.

C#
protected override void SetForeColorThemeOverrides()

Overrides: RadControl.SetForeColorThemeOverrides()

Updates the validation panel visibility.

C#
public virtual void UpdateValidationPanelVisibility()

Events

Occurs when binding object is created.

C#
public event BindingCreatedEventHandler BindingCreated

Occurs when a binding object for an editor is about to be created. This event is cancelable.

C#
public event BindingCreatingEventHandler BindingCreating

Occurs when the editor is Initialized.

C#
public event EditorInitializedEventHandler EditorInitialized

Occurs when editor is being initialized. This event is cancelable

C#
public event EditorInitializingEventHandler EditorInitializing

Occurs the item is already Initialized.

C#
public event DataLayoutItemInitializedEventHandler ItemInitialized

This event is firing when the item associated with a given field is about to be Initialized. This event is cancelable..

C#
public event DataLayoutItemInitializingEventHandler ItemInitializing

Occurs when the value of editor is changed.

C#
public event DataLayoutItemValidatedEventHandler ItemValidated

Occurs when the value of editor is about to change.

C#
public event DataLayoutItemValidatingEventHandler ItemValidating