ClassRadDataEntry
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.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[TelerikToolboxCategory("Editors")]
public class RadDataEntry : RadScrollablePanel, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadScrollablePanelRadDataEntry
Implements:
Inherited Members
Constructors
RadDataEntry()
Initializes a new instance of the RadDataEntry class.
Declaration
public RadDataEntry()
Properties
AutoSize
Gets or sets whether the RadDataEntry control is auto-sized.
Declaration
[Browsable(false)]
public override bool AutoSize { get; set; }
Property Value
true if auto-sizing is enabled; otherwise, false.
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
[Browsable(true)]
public bool AutoSizeLabels { get; set; }
Property Value
true if labels should be auto-sized for alignment; otherwise, false.
ColumnCount
Gets or sets the number of columns that RadDataEntry will use to arrange generated controls.
Declaration
[Browsable(true)]
public int ColumnCount { get; set; }
Property Value
The number of columns. Must be at least 1.
CurrentObject
Gets the current object from the data source at the current position.
Declaration
[Browsable(false)]
public object CurrentObject { get; }
Property Value
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
[Browsable(false)]
public RadDataEntryElement DataEntryElement { get; }
Property Value
The RadDataEntryElement instance.
DataSource
Gets or sets the data source for the RadDataEntry control.
Declaration
[Browsable(true)]
public object DataSource { get; set; }
Property Value
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
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
[Browsable(true)]
public bool FitToParentWidth { get; set; }
Property Value
true if editors should fit to parent width; otherwise, false to use ItemDefaultSize.
FlowDirection
Gets or sets the flow direction for generating editors when the ColumnCount property is greater than 1.
Declaration
[Browsable(true)]
public FlowDirection FlowDirection { get; set; }
Property Value
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
[Browsable(true)]
public Size ItemDefaultSize { get; set; }
Property Value
The default size of generated editor items.
ItemSpace
Gets or sets the spacing between the generated editor items.
Declaration
[Browsable(true)]
public int ItemSpace { get; set; }
Property Value
The item space in pixels.
Manager
Gets the BindingManagerBase manager that is used for the current data source.
Declaration
[Browsable(false)]
public BindingManagerBase Manager { get; }
Property Value
The binding manager instance.
ShowValidationPanel
Gets or sets a value indicating whether the validation panel should be visible.
Declaration
[Browsable(false)]
public bool ShowValidationPanel { get; set; }
Property Value
true if the validation panel should be shown; otherwise, false.
ValidationPanel
Gets the validation panel that displays validation messages and errors.
Declaration
[Browsable(true)]
public ValidationPanel ValidationPanel { get; }
Property Value
The ValidationPanel instance.
Methods
CreateControlsInstance()
Creates a custom controls collection for managing data entry controls.
Declaration
protected override Control.ControlCollection CreateControlsInstance()
Returns
A DataEntryPanelControlCollection instance.
Overrides
CreatePanelElement()
Creates the main panel element that contains the data entry functionality.
Declaration
protected override RadScrollablePanelElement CreatePanelElement()
Returns
A new RadDataEntryElement instance.
Overrides
CreateScrollablePanelContainer()
Creates a custom scrollable panel container for the data entry control.
Declaration
protected override RadScrollablePanelContainer CreateScrollablePanelContainer()
Returns
A new DataEntryScrollablePanelContainer instance.
Overrides
Dispose(bool)
Releases unmanaged and optionally managed resources used by the RadDataEntry.
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources.
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.
OnBindingCreated(object, BindingCreatedEventArgs)
Raises the BindingCreated event.
Declaration
protected virtual void OnBindingCreated(object sender, BindingCreatedEventArgs e)
Parameters
sender
The sender of the event.
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
sender
The sender of the event.
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
sender
The sender of the event.
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
sender
The sender of the event.
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
sender
The sender of the event.
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
sender
The sender of the event.
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
sender
The sender of the event.
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
sender
The sender of the event.
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
factor
The factor by which the control should be scaled.
specified
A bitwise combination of the 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 Value
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 Value
EditorInitialized
Occurs when an editor control has been successfully initialized.
Declaration
public event EditorInitializedEventHandler EditorInitialized
Event Value
EditorInitializing
Occurs when an editor control is being initialized. This event can be cancelled to prevent editor creation.
Declaration
public event EditorInitializingEventHandler EditorInitializing
Event Value
ItemInitialized
Occurs when a property item container has been successfully initialized.
Declaration
public event ItemInitializedEventHandler ItemInitialized
Event Value
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 Value
ItemValidated
Occurs when an editor item has been validated and validation has completed.
Declaration
public event ItemValidatedEventHandler ItemValidated
Event Value
ItemValidating
Occurs when an editor item is being validated and validation rules are being checked.
Declaration
public event ItemValidatingEventHandler ItemValidating
Event Value