Class SfDataForm
DataForm control provides UI for editing all the public properties
of data object with appropriate editors based on type of property.
DataForm control provides options to control editing, validation of data
and customization of layout.
Inheritance
Implements
Namespace: Syncfusion.iOS.DataForm
Assembly: Syncfusion.SfDataForm.iOS.dll
Syntax
public class SfDataForm : UIView, IComponent, IDisposable
  Constructors
SfDataForm()
Initializes a new instance of the SfDataForm class.
Declaration
public SfDataForm()
  SfDataForm(CGRect)
Initializes a new instance of the SfDataForm class.
Declaration
public SfDataForm(CGRect rect)
  Parameters
| Type | Name | Description | 
|---|---|---|
| CoreGraphics.CGRect | rect | Rectangle value for the DataForm frame  | 
      
SfDataForm(IntPtr)
Initializes a new instance of the SfDataForm class.
Declaration
public SfDataForm(IntPtr ptr)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.IntPtr | ptr | Java Native Interface object reference.  | 
      
Properties
ColumnCount
Gets or sets the value denotes the number of editor to be arranged per row. Be default one editor for one property arranged with label.
Declaration
public int ColumnCount { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Int32 | The default value is one.  | 
      
CommitMode
Gets or sets the value that determines, when the value entered by user should be saved to the data object.
Declaration
public CommitMode CommitMode { get; set; }
  Property Value
| Type | Description | 
|---|---|
| CommitMode | The default value is LostFocus.  | 
      
DataObject
Gets or sets a data object to view or edit the properties. DataForm generates the editors and labels from the public properties of data object.
Declaration
public object DataObject { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Object | The default value is null.  | 
      
EditorWidth
Gets or sets the editor width.
Declaration
public int EditorWidth { get; set; }
  Property Value
| Type | 
|---|
| System.Int32 | 
IsReadOnly
Gets or sets a value that indicates whether editors enabled for editing.
Declaration
public bool IsReadOnly { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | The default value is false.  | 
      
Remarks
IsReadOnly takes higher priority when explicit defined. Editors can be enabled or disabled for particular property by setting IsReadOnly in AutoGeneratingDataFormItem. Editors can be enabled or disabled for particular property by setting System.ComponentModel.DataAnnotations.EditableAttribute.AllowEdit.
ItemManager
Gets the reference to the DataFormItemManager instance which generates DataFormItem with default settings based on attribute setting.
Declaration
public DataFormItemManager ItemManager { get; set; }
  Property Value
| Type | 
|---|
| DataFormItemManager | 
LabelPosition
Gets or sets the value denotes how to layout the label associated with editor. Label's can be positioned either at the top or left side of editor.
Declaration
public LabelPosition LabelPosition { get; set; }
  Property Value
| Type | Description | 
|---|---|
| LabelPosition | The default value is Left.  | 
      
LabelWidth
Gets or sets the label width.
Declaration
public int LabelWidth { get; set; }
  Property Value
| Type | 
|---|
| System.Int32 | 
LayoutManager
Gets or sets the reference to the DataFormLayoutManager instance which layouts labels and editors in DataFormItemView.
Declaration
public DataFormLayoutManager LayoutManager { get; set; }
  Property Value
| Type | 
|---|
| DataFormLayoutManager | 
Site
Provides functionality required by sites.
Declaration
public ISite Site { get; set; }
  Property Value
| Type | 
|---|
| System.ComponentModel.ISite | 
SourceProvider
Gets or sets the reference to the SourceProvider instance which is used to get the source for picker type editors.
Declaration
public SourceProvider SourceProvider { get; set; }
  Property Value
| Type | 
|---|
| SourceProvider | 
ValidationMode
Gets or sets a value that denotes when the user input should be validated based on IDataErrorInfo and System.ComponentModel.DataAnnotations.ValidationAttribute.
Declaration
public ValidationMode ValidationMode { get; set; }
  Property Value
| Type | Description | 
|---|---|
| ValidationMode | One of the ValidationMode enum. The default value is LostFocus.  | 
      
Remarks
The SfDataForm process the built-in validations when data object implements IDataErrorInfo or property defined with System.ComponentModel.DataAnnotations.ValidationAttribute. The validation can be performed explicitly by handling Validating property of SfDataForm.
Methods
AwakeFromNib()
Called after the object has been loaded form the nib file.
Declaration
public override void AwakeFromNib()
  CollapseGroup(String)
Collapse group by group name.
Declaration
public void CollapseGroup(string groupName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | groupName | The name of the group.  | 
      
Commit()
Commits all property values in data form items.
Declaration
public void Commit()
  Commit(String)
Commits the value of the specific property.
Declaration
public void Commit(string propertyName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | propertyName | 
Dispose(Boolean)
Disposes all the resources used by the SfDataForm class.
Declaration
protected override void Dispose(bool isDisposing)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Boolean | isDisposing | Indicates whether the call is from Dispose method or from a finalizer.  | 
      
ExpandGroup(String)
Expands group by group name.
Declaration
public void ExpandGroup(string groupName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | groupName | The name of the group.  | 
      
GetGroupCollapseIcon()
Gets the group collapse icon.
Declaration
public virtual UIImage GetGroupCollapseIcon()
  Returns
| Type | Description | 
|---|---|
| UIKit.UIImage | The UIImage for the group collapse icon.  | 
      
GetGroupExpanderIcon()
Gets the group expander icon.
Declaration
public virtual UIImage GetGroupExpanderIcon()
  Returns
| Type | Description | 
|---|---|
| UIKit.UIImage | The UIImage for the group expander icon.  | 
      
LayoutSubviews()
Disposes all the resources used by the SfDataForm class.
Declaration
public override void LayoutSubviews()
  RefreshLayout(Boolean)
Loads more fields when the user wants to generate the fields that was canceled.
Declaration
public void RefreshLayout(bool generateAllItems = false)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Boolean | generateAllItems | True to regenerate all the items from the committed data object. false only generate the field that was canceled initially.  | 
      
RegisterEditor(String, DataFormEditorBase)
Register custom editor with editor name.
Declaration
public void RegisterEditor(string editorName, DataFormEditorBase dataFormEditor)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | editorName | The editorName to use the CustomEditor for the property.  | 
      
| DataFormEditorBase | dataFormEditor | The custom dataFormEditor to load the customized editor for property.  | 
      
RegisterEditor(String, String)
Registers editor for property name.
Declaration
public void RegisterEditor(string propertyName, string editor)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | propertyName | The propertyName to have editor.  | 
      
| System.String | editor | The editor that loaded for property name.  | 
      
RegisterEditor(Type, String)
Registers editor for property type.
Declaration
public void RegisterEditor(Type type, string editor)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Type | type | The type to have editor.  | 
      
| System.String | editor | The editor that loaded for type.  | 
      
ScrollTo(String)
Scrolls to specific editor in data form.
Declaration
public void ScrollTo(string propertyName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | propertyName | 
UpdateEditor(String)
Updates the value of the specific property in corresponding editor.
Declaration
public void UpdateEditor(string propertyName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | propertyName | The property to be updated.  | 
      
Validate()
Validates all property values of data form items.
Declaration
public bool Validate()
  Returns
| Type | 
|---|
| System.Boolean | 
Validate(String)
Validates the value of the specific property.
Declaration
public bool Validate(string propertyName)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | propertyName | The property to be validated.  | 
      
Returns
| Type | 
|---|
| System.Boolean | 
Events
AutoGeneratingDataFormItem
Occurs for each DataFormItem or DataFormGroupItem generated for the public properties of data object.
Declaration
public event EventHandler<AutoGeneratingDataFormItemEventArgs> AutoGeneratingDataFormItem
  Event Type
| Type | 
|---|
| System.EventHandler<AutoGeneratingDataFormItemEventArgs> | 
Remarks
You can cancel the event for particular property to stop it from showing in display. Also you can customize the settings using DataFormItem or DataFormGroupItem.
Disposed
Represents the method that handles the Disposed event of a component.
Declaration
public event EventHandler Disposed
  Event Type
| Type | 
|---|
| System.EventHandler | 
GroupItemCollapsed
Occurs when group gets collapsed by user.
Declaration
public event EventHandler<GroupItemCollapsedEventArgs> GroupItemCollapsed
  Event Type
| Type | 
|---|
| System.EventHandler<GroupItemCollapsedEventArgs> | 
GroupItemCollapsing
Occurs when user try collapse a group. You can cancel the user action using this event.
Declaration
public event EventHandler<GroupItemCollapsingEventArgs> GroupItemCollapsing
  Event Type
| Type | 
|---|
| System.EventHandler<GroupItemCollapsingEventArgs> | 
Remarks
You can cancel the user action by using GroupItemCollapsingEventArgs.
GroupItemExpanded
Occurs when group expanded by user.
Declaration
public event EventHandler<GroupItemExpandedEventArgs> GroupItemExpanded
  Event Type
| Type | 
|---|
| System.EventHandler<GroupItemExpandedEventArgs> | 
GroupItemExpanding
Occurs when user try expand a group. You can cancel the user action using this event.
Declaration
public event EventHandler<GroupItemExpandingEventArgs> GroupItemExpanding
  Event Type
| Type | 
|---|
| System.EventHandler<GroupItemExpandingEventArgs> | 
Remarks
You can cancel the user action by using GroupItemExpandingEventArgs.
Validated
Occurs after completion of user input validation.
Declaration
public event EventHandler<ValidatedEventArgs> Validated
  Event Type
| Type | 
|---|
| System.EventHandler<ValidatedEventArgs> | 
Validating
Occurs when SfDataForm validates the user input.
Declaration
public event EventHandler<ValidatingEventArgs> Validating
  Event Type
| Type | 
|---|
| System.EventHandler<ValidatingEventArgs> | 
ValidationCompleted
Occurs when Explicit to get the invalid DataFormItems details.
Declaration
public event EventHandler<ValidationCompletedEventArgs> ValidationCompleted
  Event Type
| Type | 
|---|
| System.EventHandler<ValidationCompletedEventArgs> |