Class RadDataEntry
Represents a data entry control that automatically generates input controls based on data source properties. The RadDataEntry class is a wrapper for the RadDataEntryElement which contains the core functionality. This control supports automatic editor generation, validation, and flexible layout options for data-bound forms.
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[TelerikToolboxCategory("Editors")]
public class RadDataEntry : RadScrollablePanel, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IPCHost, IAnalyticsProvider
Constructors
RadDataEntry()
Properties
AutoSize
Gets or sets whether the RadDataEntry control is auto-sized.
Declaration
public override bool AutoSize { get; set; }
Property Value
System.Boolean
|
Overrides
AutoSizeLabels
Gets or sets a value indicating whether labels of the editors should be automatically sized to align properly in columns according to the longest text.
Declaration
public bool AutoSizeLabels { get; set; }
Property Value
System.Boolean
|
ColumnCount
Gets or sets the number of columns that RadDataEntry will use to arrange generated controls.
Declaration
public int ColumnCount { get; set; }
Property Value
System.Int32
The number of columns. Must be at least 1. |
CurrentObject
Gets the current object from the data source at the current position.
Declaration
public object CurrentObject { get; }
Property Value
System.Object
The current object, or null if no object is available at the current position. |
DataEntryElement
Gets the instance of RadDataEntryElement wrapped by this control. RadDataEntryElement is the main element in the hierarchy tree and encapsulates the actual functionality of RadDataEntry.
Declaration
public RadDataEntryElement DataEntryElement { get; }
Property Value
RadDataEntryElement
The RadDataEntryElement instance. |
DataSource
Gets or sets the data source for the RadDataEntry control.
Declaration
public object DataSource { get; set; }
Property Value
System.Object
The data source object. Setting to null will clear all generated editors. |
DefaultSize
Gets the default size of the RadDataEntry control.
Declaration
protected override Size DefaultSize { get; }
Property Value
System.Drawing.Size
The default size of the control. |
Overrides
FitToParentWidth
Gets or sets a value indicating whether the generated editors should automatically fit their width to the width of the RadDataEntry.
Declaration
public bool FitToParentWidth { get; set; }
Property Value
System.Boolean
|
FlowDirection
Gets or sets the flow direction for generating editors when the ColumnCount property is greater than 1.
Declaration
public FlowDirection FlowDirection { get; set; }
Property Value
System.Windows.Forms.FlowDirection
The flow direction that determines how controls are arranged across columns. |
ItemDefaultSize
Gets or sets the default size that generated items should have when FitToParentWidth is false. When FitToParentWidth is true, the width is calculated based on the RadDataEntry width.
Declaration
public Size ItemDefaultSize { get; set; }
Property Value
System.Drawing.Size
The default size of generated editor items. |
ItemSpace
Gets or sets the spacing between the generated editor items.
Declaration
public int ItemSpace { get; set; }
Property Value
System.Int32
The item space in pixels. |
Manager
Gets the System.Windows.Forms.BindingManagerBase manager that is used for the current data source.
Declaration
public BindingManagerBase Manager { get; }
Property Value
System.Windows.Forms.BindingManagerBase
The binding manager instance. |
ShowValidationPanel
Gets or sets a value indicating whether the validation panel should be visible.
Declaration
public bool ShowValidationPanel { get; set; }
Property Value
System.Boolean
|
Text
This property is not relevant for this class.
Declaration
public override string Text { get; set; }
Property Value
System.String
|
Overrides
ValidationPanel
Gets the validation panel that displays validation messages and errors.
Declaration
public ValidationPanel ValidationPanel { get; }
Property Value
ValidationPanel
The ValidationPanel instance. |
Methods
CreateControlsInstance()
Creates a custom controls collection for managing data entry controls.
Declaration
protected override Control.ControlCollection CreateControlsInstance()
Returns
System.Windows.Forms.Control.ControlCollection
A DataEntryPanelControlCollection instance. |
Overrides
CreatePanelElement()
Creates the main panel element that contains the data entry functionality.
Declaration
protected override RadScrollablePanelElement CreatePanelElement()
Returns
RadScrollablePanelElement
A new RadDataEntryElement instance. |
Overrides
CreateScrollablePanelContainer()
Creates a custom scrollable panel container for the data entry control.
Declaration
protected override RadScrollablePanelContainer CreateScrollablePanelContainer()
Returns
RadScrollablePanelContainer
A new DataEntryScrollablePanelContainer instance. |
Overrides
Dispose(Boolean)
Releases unmanaged and optionally managed resources used by the RadDataEntry.
Declaration
protected override void Dispose(bool disposing)
Parameters
System.Boolean
disposing
|
Overrides
EndInit()
Completes the initialization process and handles data source initialization if necessary.
Declaration
public override void EndInit()
Overrides
InitializeInternalControls()
Initializes the internal controls including the validation panel.
Declaration
protected override void InitializeInternalControls()
Overrides
InsertInternalControls()
Inserts the internal controls including the validation panel into the control's collection.
Declaration
protected override void InsertInternalControls()
Overrides
OnBindingContextChanged(EventArgs)
Handles the binding context change event and notifies the data entry element.
Declaration
protected override void OnBindingContextChanged(EventArgs e)
Parameters
System.EventArgs
e
The System.EventArgs containing event data. |
Overrides
OnBindingCreated(Object, BindingCreatedEventArgs)
Raises the BindingCreated event.
Declaration
protected virtual void OnBindingCreated(object sender, BindingCreatedEventArgs e)
Parameters
System.Object
sender
The sender of the event. |
BindingCreatedEventArgs
e
The BindingCreatedEventArgs instance containing the event data. |
OnBindingCreating(Object, BindingCreatingEventArgs)
Raises the BindingCreating event.
Declaration
protected virtual void OnBindingCreating(object sender, BindingCreatingEventArgs e)
Parameters
System.Object
sender
The sender of the event. |
BindingCreatingEventArgs
e
The BindingCreatingEventArgs instance containing the event data. |
OnEditorInitialized(Object, EditorInitializedEventArgs)
Raises the EditorInitialized event.
Declaration
protected virtual void OnEditorInitialized(object sender, EditorInitializedEventArgs e)
Parameters
System.Object
sender
The sender of the event. |
EditorInitializedEventArgs
e
The EditorInitializedEventArgs instance containing the event data. |
OnEditorInitializing(Object, EditorInitializingEventArgs)
Raises the EditorInitializing event.
Declaration
protected virtual void OnEditorInitializing(object sender, EditorInitializingEventArgs e)
Parameters
System.Object
sender
The sender of the event. |
EditorInitializingEventArgs
e
The EditorInitializingEventArgs instance containing the event data. |
OnItemInitialized(Object, ItemInitializedEventArgs)
Raises the ItemInitialized event.
Declaration
protected virtual void OnItemInitialized(object sender, ItemInitializedEventArgs e)
Parameters
System.Object
sender
The sender of the event. |
ItemInitializedEventArgs
e
The ItemInitializedEventArgs instance containing the event data. |
OnItemInitializing(Object, ItemInitializingEventArgs)
Raises the ItemInitializing event.
Declaration
protected virtual void OnItemInitializing(object sender, ItemInitializingEventArgs e)
Parameters
System.Object
sender
The sender of the event. |
ItemInitializingEventArgs
e
The ItemInitializingEventArgs instance containing the event data. |
OnItemValidated(Object, ItemValidatedEventArgs)
Raises the ItemValidated event.
Declaration
protected virtual void OnItemValidated(object sender, ItemValidatedEventArgs e)
Parameters
System.Object
sender
The sender of the event. |
ItemValidatedEventArgs
e
The ItemValidatedEventArgs instance containing the event data. |
OnItemValidating(Object, ItemValidatingEventArgs)
Raises the ItemValidating event.
Declaration
protected virtual void OnItemValidating(object sender, ItemValidatingEventArgs e)
Parameters
System.Object
sender
The sender of the event. |
ItemValidatingEventArgs
e
The ItemValidatingEventArgs instance containing the event data. |
OnThemeChanged()
Handles theme changes and applies special layout adjustments for Material themes.
Declaration
protected override void OnThemeChanged()
Overrides
ResetBackColorThemeOverrides()
Resets theme overrides for the BackColor property to restore default theme values.
Declaration
protected override void ResetBackColorThemeOverrides()
Overrides
ResetForeColorThemeOverrides()
Resets theme overrides for the ForeColor property to restore default theme values.
Declaration
protected override void ResetForeColorThemeOverrides()
Overrides
ScaleControl(SizeF, BoundsSpecified)
Scales the control by the specified factor for DPI scaling support.
Declaration
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
Parameters
System.Drawing.SizeF
factor
The factor by which the control should be scaled. |
System.Windows.Forms.BoundsSpecified
specified
A bitwise combination of the System.Windows.Forms.BoundsSpecified values specifying the bounds of the control to use when defining its size and position. |
Overrides
SetBackColorThemeOverrides()
Sets theme overrides for the BackColor property to apply custom background colors.
Declaration
protected override void SetBackColorThemeOverrides()
Overrides
SetForeColorThemeOverrides()
Sets theme overrides for the ForeColor property to apply custom foreground colors.
Declaration
protected override void SetForeColorThemeOverrides()
Overrides
UpdateValidationPanelVisibility()
Updates the validation panel visibility based on the ShowValidationPanel property and whether there are any validation controls.
Declaration
public virtual void UpdateValidationPanelVisibility()
Events
BindingCreated
Occurs when a data binding has been successfully created for an editor control.
Declaration
public event BindingCreatedEventHandler BindingCreated
Event Type
BindingCreatedEventHandler
|
BindingCreating
Occurs when a data binding is being created for an editor control. This event can be cancelled to prevent binding creation.
Declaration
public event BindingCreatingEventHandler BindingCreating
Event Type
BindingCreatingEventHandler
|
EditorInitialized
Occurs when an editor control has been successfully initialized.
Declaration
public event EditorInitializedEventHandler EditorInitialized
Event Type
EditorInitializedEventHandler
|
EditorInitializing
Occurs when an editor control is being initialized. This event can be cancelled to prevent editor creation.
Declaration
public event EditorInitializingEventHandler EditorInitializing
Event Type
EditorInitializingEventHandler
|
ItemInitialized
Occurs when a property item container has been successfully initialized.
Declaration
public event ItemInitializedEventHandler ItemInitialized
Event Type
ItemInitializedEventHandler
|
ItemInitializing
Occurs when a property item container is being initialized. This event can be cancelled to prevent item creation.
Declaration
public event ItemInitializingEventHandler ItemInitializing
Event Type
ItemInitializingEventHandler
|
ItemValidated
Occurs when an editor item has been validated and validation has completed.
Declaration
public event ItemValidatedEventHandler ItemValidated
Event Type
ItemValidatedEventHandler
|
ItemValidating
Occurs when an editor item is being validated and validation rules are being checked.
Declaration
public event ItemValidatingEventHandler ItemValidating
Event Type
ItemValidatingEventHandler
|