Class DataForm
Displays data in a customizable form.
Inherited Members
Namespace: System.Windows.Controls
Assembly: DataForm.Toolkit.OpenSilver.dll
Syntax
public class DataForm : Control
Constructors
| Improve this Doc View SourceDataForm()
Constructs a new instance of DataForm.
Declaration
public DataForm()
Fields
| Improve this Doc View SourceAutoCommitProperty
Identifies the AutoCommit dependency property.
Declaration
public static readonly DependencyProperty AutoCommitProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
AutoEditProperty
Identifies the AutoEdit dependency property.
Declaration
public static readonly DependencyProperty AutoEditProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
AutoGenerateFieldsProperty
Identifies the AutoGenerateFields dependency property.
Declaration
public static readonly DependencyProperty AutoGenerateFieldsProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CancelButtonContentProperty
Identifies the CancelButtonContent dependency property.
Declaration
public static readonly DependencyProperty CancelButtonContentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CancelButtonStyleProperty
Identifies the CancelButtonContent dependency property.
Declaration
public static readonly DependencyProperty CancelButtonStyleProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CommandButtonsVisibilityProperty
Identifies the CommandButtonsVisibility dependency property.
Declaration
public static readonly DependencyProperty CommandButtonsVisibilityProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CommitButtonContentProperty
Identifies the CommitButtonContent dependency property.
Declaration
public static readonly DependencyProperty CommitButtonContentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CommitButtonStyleProperty
Identifies the CommitButtonStyle dependency property.
Declaration
public static readonly DependencyProperty CommitButtonStyleProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ContentProperty
Identifies the Content dependency property.
Declaration
public static readonly DependencyProperty ContentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CurrentIndexProperty
Identifies the CurrentIndex dependency property.
Declaration
public static readonly DependencyProperty CurrentIndexProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CurrentItemProperty
Identifies the CurrentItem dependency property.
Declaration
public static readonly DependencyProperty CurrentItemProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
DataFieldStyleProperty
Identifies the DataFieldStyle dependency property.
Declaration
public static readonly DependencyProperty DataFieldStyleProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
DescriptionViewerPositionProperty
Identifies the DescriptionViewerPosition dependency property.
Declaration
public static readonly DependencyProperty DescriptionViewerPositionProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
EditTemplateProperty
Identifies the EditTemplate dependency property.
Declaration
public static readonly DependencyProperty EditTemplateProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
HeaderProperty
Identifies the Header dependency property.
Declaration
public static readonly DependencyProperty HeaderProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
HeaderTemplateProperty
Identifies the HeaderTemplate dependency property.
Declaration
public static readonly DependencyProperty HeaderTemplateProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
HeaderVisibilityProperty
Identifies the HeaderTemplate dependency property.
Declaration
public static readonly DependencyProperty HeaderVisibilityProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsEmptyProperty
Identifies the IsEmpty dependency property.
Declaration
public static readonly DependencyProperty IsEmptyProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsItemChangedProperty
Identifies the IsItemChanged dependency property.
Declaration
public static readonly DependencyProperty IsItemChangedProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsItemValidProperty
Identifies the IsItemValid dependency property.
Declaration
public static readonly DependencyProperty IsItemValidProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsReadOnlyProperty
Identifies the IsReadOnly dependency property.
Declaration
public static readonly DependencyProperty IsReadOnlyProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ItemsSourceProperty
Identifies the ItemsSource dependency property.
Declaration
public static readonly DependencyProperty ItemsSourceProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
LabelPositionProperty
Identifies the LabelPosition dependency property.
Declaration
public static readonly DependencyProperty LabelPositionProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ModeProperty
Identifies the Mode dependency property.
Declaration
public static readonly DependencyProperty ModeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
NewItemTemplateProperty
Identifies the NewItemTemplate dependency property.
Declaration
public static readonly DependencyProperty NewItemTemplateProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ReadOnlyTemplateProperty
Identifies the ReadOnlyTemplate dependency property.
Declaration
public static readonly DependencyProperty ReadOnlyTemplateProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ValidationSummaryStyleProperty
Identifies the ValidationSummaryStyle dependency property.
Declaration
public static readonly DependencyProperty ValidationSummaryStyleProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceAutoCommit
Gets or sets a value that indicates whether edited items are committed when the current item is changed.
Declaration
public bool AutoCommit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
AutoEdit
Gets or sets a value that indicates whether or not the DataForm should be permanently in edit mode.
Declaration
public bool AutoEdit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
AutoGenerateFields
Gets or sets a value that indicates whether or not to automatically generate the DataFields collection.
Declaration
public bool AutoGenerateFields { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
CancelButtonContent
Gets or sets the content of the Cancel button.
Declaration
public object CancelButtonContent { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
CancelButtonStyle
Gets or sets the style of the Cancel button.
Declaration
public Style CancelButtonStyle { get; set; }
Property Value
Type | Description |
---|---|
Style |
CommandButtonsVisibility
Gets or sets a value that indicates which command buttons are visible on the DataForm .
Declaration
public DataFormCommandButtonsVisibility? CommandButtonsVisibility { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<DataFormCommandButtonsVisibility> |
CommitButtonContent
Gets or sets the content of the Commit button.
Declaration
public object CommitButtonContent { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
CommitButtonStyle
Gets or sets the style of the Commit button.
Declaration
public Style CommitButtonStyle { get; set; }
Property Value
Type | Description |
---|---|
Style |
Content
Gets or sets the direct content of the DataForm, to be used when a template is not specified.
Declaration
public FrameworkElement Content { get; set; }
Property Value
Type | Description |
---|---|
FrameworkElement |
CurrentIndex
Gets or sets the index of the current item.
Declaration
public int CurrentIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
CurrentItem
Gets or sets the current item.
Declaration
public object CurrentItem { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
DataFieldStyle
Gets or sets the developer-specified style for DataFields.
Declaration
public Style DataFieldStyle { get; set; }
Property Value
Type | Description |
---|---|
Style |
DescriptionViewerPosition
Gets or sets a value that indicates the position of descriptions in relation to the field.
Declaration
public DataFieldDescriptionViewerPosition DescriptionViewerPosition { get; set; }
Property Value
Type | Description |
---|---|
DataFieldDescriptionViewerPosition |
EditTemplate
Gets or sets the DataTemplate used when editing.
Declaration
public DataTemplate EditTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
ForceAlignment
Gets or sets a value that indicates if datafields should run the alignment logic. The default value is true.
Declaration
public bool ForceAlignment { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Header
Gets or sets the header for the DataForm .
Declaration
public object Header { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
HeaderTemplate
Gets or sets the DataTemplate used for the header of the DataForm .
Declaration
public DataTemplate HeaderTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
HeaderVisibility
Gets or sets a value that indicates whether the header is visible.
Declaration
public Visibility HeaderVisibility { get; set; }
Property Value
Type | Description |
---|---|
Visibility |
IsEmpty
Gets a value that indicates whether or not the control is displaying an item.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsItemChanged
Gets a value that indicates whether or not the current item has been changed.
Declaration
public bool IsItemChanged { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsItemValid
Gets a value that indicates whether or not the current item is valid.
Declaration
public bool IsItemValid { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsReadOnly
Gets or sets a value that indicates whether the user can edit the values in the control.
Declaration
public bool IsReadOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ItemsSource
Gets or sets a collection that is used to populate the form content of the control.
Declaration
public IEnumerable ItemsSource { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.IEnumerable |
LabelPosition
Gets or sets a value that indicates the position of labels in relation to the field.
Declaration
public DataFieldLabelPosition LabelPosition { get; set; }
Property Value
Type | Description |
---|---|
DataFieldLabelPosition |
Mode
Gets a value that indicates whether the control is in read only, edit, or add new mode.
Declaration
public DataFormMode Mode { get; }
Property Value
Type | Description |
---|---|
DataFormMode |
NewItemTemplate
Gets or sets the item template used when adding a new item.
Declaration
public DataTemplate NewItemTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
ReadOnlyTemplate
Gets or sets the item template used when not editing.
Declaration
public DataTemplate ReadOnlyTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
ValidationSummary
Gets the ValidationSummary.
Declaration
public ValidationSummary ValidationSummary { get; }
Property Value
Type | Description |
---|---|
ValidationSummary |
ValidationSummaryStyle
Gets or sets the developer-specified style for the ValidationSummary.
Declaration
public Style ValidationSummaryStyle { get; set; }
Property Value
Type | Description |
---|---|
Style |
Methods
| Improve this Doc View SourceAddNewItem()
Adds a new item.
Declaration
public bool AddNewItem()
Returns
Type | Description |
---|---|
System.Boolean | Whether or not a new item was added. |
BeginEdit()
Begins the editing of the current item.
Declaration
public bool BeginEdit()
Returns
Type | Description |
---|---|
System.Boolean | Whether or not editing was begun. |
CancelEdit()
Cancels the editing of the current item.
Declaration
public bool CancelEdit()
Returns
Type | Description |
---|---|
System.Boolean | Whether or not the cancellation was successful. |
CommitEdit()
Commits the edit of the current item and exits editing mode.
Declaration
public bool CommitEdit()
Returns
Type | Description |
---|---|
System.Boolean | True if the commit succeeds; false otherwise. |
CommitEdit(Boolean)
Commits the edit of the current item.
Declaration
public bool CommitEdit(bool exitEditingMode)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | exitEditingMode | Whether or not editing mode should be exited after committing the edit. |
Returns
Type | Description |
---|---|
System.Boolean | True if the commit succeeds; false otherwise. |
DeleteItem()
Deletes the current item.
Declaration
public bool DeleteItem()
Returns
Type | Description |
---|---|
System.Boolean | Whether or not the item was deleted. |
FindNameInContent(String)
Finds an object with a given name in the DataForm's content.
Declaration
public object FindNameInContent(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name to search by. |
Returns
Type | Description |
---|---|
System.Object | The object, if found. |
OnAddingNewItem(DataFormAddingNewItemEventArgs)
Raises the AddingItem event.
Declaration
protected virtual void OnAddingNewItem(DataFormAddingNewItemEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataFormAddingNewItemEventArgs | e | The event args. |
OnApplyTemplate()
Applies the template for this control.
Declaration
public override void OnApplyTemplate()
Overrides
| Improve this Doc View SourceOnAutoGeneratingField(DataFormAutoGeneratingFieldEventArgs)
Raises the AutoGeneratingField event.
Declaration
protected virtual void OnAutoGeneratingField(DataFormAutoGeneratingFieldEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataFormAutoGeneratingFieldEventArgs | e | The event args. |
OnBeginningEdit(CancelEventArgs)
Raises the BeginningEdit event.
Declaration
protected virtual void OnBeginningEdit(CancelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
CancelEventArgs | e | The event args. |
OnContentLoaded(DataFormContentLoadEventArgs)
Raises the ContentLoaded event.
Declaration
protected virtual void OnContentLoaded(DataFormContentLoadEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataFormContentLoadEventArgs | e | The event args. |
OnContentLoading(DataFormContentLoadEventArgs)
Raises the ContentLoading event.
Declaration
protected virtual void OnContentLoading(DataFormContentLoadEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataFormContentLoadEventArgs | e | The event args. |
OnCreateAutomationPeer()
Returns an automation peer for this DataForm.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type | Description |
---|---|
AutomationPeer | The automation peer. |
Overrides
| Improve this Doc View SourceOnCurrentItemChanged(EventArgs)
Raises the CurrentItemChanged event.
Declaration
protected virtual void OnCurrentItemChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | The event args. |
OnDeletingItem(CancelEventArgs)
Raises the DeletingItem event.
Declaration
protected virtual void OnDeletingItem(CancelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
CancelEventArgs | e | The event args. |
OnItemEditEnded(DataFormEditEndedEventArgs)
Raises the ItemEditEnded event.
Declaration
protected virtual void OnItemEditEnded(DataFormEditEndedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataFormEditEndedEventArgs | e | The event args. |
OnItemEditEnding(DataFormEditEndingEventArgs)
Raises the ItemEditEnding event.
Declaration
protected virtual void OnItemEditEnding(DataFormEditEndingEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
DataFormEditEndingEventArgs | e | The event args. |
OnValidatingItem(CancelEventArgs)
Raises the ValidatingItem event.
Declaration
protected virtual void OnValidatingItem(CancelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
CancelEventArgs | e | The event args. |
ValidateItem()
Validates the current item.
Declaration
public bool ValidateItem()
Returns
Type | Description |
---|---|
System.Boolean | Whether or not the current item is valid. |
Events
| Improve this Doc View SourceAddingNewItem
Event handler for when an item is being added.
Declaration
public event EventHandler<DataFormAddingNewItemEventArgs> AddingNewItem
Event Type
Type | Description |
---|---|
System.EventHandler<DataFormAddingNewItemEventArgs> |
AutoGeneratingField
Event handler for when a field is being auto-generated.
Declaration
public event EventHandler<DataFormAutoGeneratingFieldEventArgs> AutoGeneratingField
Event Type
Type | Description |
---|---|
System.EventHandler<DataFormAutoGeneratingFieldEventArgs> |
BeginningEdit
Event handler for when an edit is beginning. Cannot be canceled when AutoEdit is true.
Declaration
public event EventHandler<CancelEventArgs> BeginningEdit
Event Type
Type | Description |
---|---|
System.EventHandler<CancelEventArgs> |
ContentLoaded
Event handler for when content is loaded.
Declaration
public event EventHandler<DataFormContentLoadEventArgs> ContentLoaded
Event Type
Type | Description |
---|---|
System.EventHandler<DataFormContentLoadEventArgs> |
ContentLoading
Event handler for when content is about to be loaded.
Declaration
public event EventHandler<DataFormContentLoadEventArgs> ContentLoading
Event Type
Type | Description |
---|---|
System.EventHandler<DataFormContentLoadEventArgs> |
CurrentItemChanged
Event handler for when the current item has changed.
Declaration
public event EventHandler<EventArgs> CurrentItemChanged
Event Type
Type | Description |
---|---|
System.EventHandler<System.EventArgs> |
DeletingItem
Event handler for when an item is being deleted.
Declaration
public event EventHandler<CancelEventArgs> DeletingItem
Event Type
Type | Description |
---|---|
System.EventHandler<CancelEventArgs> |
EditEnded
Event handler for when an edit has ended.
Declaration
public event EventHandler<DataFormEditEndedEventArgs> EditEnded
Event Type
Type | Description |
---|---|
System.EventHandler<DataFormEditEndedEventArgs> |
EditEnding
Event handler for when an edit is ending.
Declaration
public event EventHandler<DataFormEditEndingEventArgs> EditEnding
Event Type
Type | Description |
---|---|
System.EventHandler<DataFormEditEndingEventArgs> |
ValidatingItem
Event handler for when the item is being validated.
Declaration
public event EventHandler<CancelEventArgs> ValidatingItem
Event Type
Type | Description |
---|---|
System.EventHandler<CancelEventArgs> |