Class DataFormItem
Represents the class that encapsulates the layout and editor setting for a data field appearing in DataForm.
Inheritance
Inherited Members
Namespace: Syncfusion.Maui.DataForm
Assembly: Syncfusion.Maui.DataForm.dll
Syntax
public abstract class DataFormItem : DataFormViewItem, IThemeElement
Constructors
DataFormItem()
Initializes a new instance of the DataFormItem class.
Declaration
protected DataFormItem()
Fields
BackgroundProperty
Identifies the Background dependency property.
Declaration
public static readonly BindableProperty BackgroundProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for Background dependency property. |
DefaultLayoutSettingsProperty
Identifies the DefaultLayoutSettings dependency property.
Declaration
public static readonly BindableProperty DefaultLayoutSettingsProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for DefaultLayoutSettings dependency property. |
EditorHeightProperty
Identifies the EditorHeight dependency property.
Declaration
public static readonly BindableProperty EditorHeightProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for EditorHeight dependency property. |
EditorTextStyleProperty
Identifies the EditorTextStyle dependency property.
Declaration
public static readonly BindableProperty EditorTextStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for EditorTextStyle dependency property. |
ErrorLabelTextStyleProperty
Identifies the ErrorLabelTextStyle dependency property.
Declaration
public static readonly BindableProperty ErrorLabelTextStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ErrorLabelTextStyle dependency property. |
FieldNameProperty
Identifies the FieldName dependency property.
Declaration
public static readonly BindableProperty FieldNameProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for FieldName dependency property. |
GroupNameProperty
Identifies the GroupName dependency property.
Declaration
public static readonly BindableProperty GroupNameProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for GroupName dependency property. |
IsReadOnlyProperty
Identifies the IsReadOnly dependency property.
Declaration
public static readonly BindableProperty IsReadOnlyProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for IsReadOnly dependency property. |
ItemsOrderInRowProperty
Identifies the ItemsOrderInRow dependency property.
Declaration
public static readonly BindableProperty ItemsOrderInRowProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ItemsOrderInRow dependency property. |
LabelTextProperty
Identifies the LabelText dependency property.
Declaration
public static readonly BindableProperty LabelTextProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for LabelText dependency property. |
LabelTextStyleProperty
Identifies the LabelTextStyle dependency property.
Declaration
public static readonly BindableProperty LabelTextStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for LabelTextStyle dependency property. |
LayoutTypeProperty
Identifies the LayoutType dependency property.
Declaration
public static readonly BindableProperty LayoutTypeProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for LayoutType dependency property. |
LeadingViewPositionProperty
Identifies the LeadingViewPosition dependency property.
Declaration
public static readonly BindableProperty LeadingViewPositionProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for LeadingViewPosition dependency property. |
LeadingViewProperty
Identifies the LeadingView dependency property.
Declaration
public static readonly BindableProperty LeadingViewProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for LeadingView dependency property. |
PlaceholderColorProperty
Identifies the PlaceholderColor dependency property.
Declaration
public static readonly BindableProperty PlaceholderColorProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for PlaceholderColor dependency property. |
PlaceholderTextProperty
Identifies the PlaceholderText dependency property.
Declaration
public static readonly BindableProperty PlaceholderTextProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for PlaceholderText dependency property. |
ShowLabelProperty
Identifies the ShowLabel dependency property.
Declaration
public static readonly BindableProperty ShowLabelProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ShowLabel dependency property. |
ShowLeadingViewProperty
Identifies the ShowLeadingView dependency property.
Declaration
public static readonly BindableProperty ShowLeadingViewProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ShowLeadingView dependency property. |
ShowTrailingViewProperty
Identifies the ShowTrailingView dependency property.
Declaration
public static readonly BindableProperty ShowTrailingViewProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ShowTrailingView dependency property. |
TextInputLayoutSettingsProperty
Identifies the TextInputLayoutSettings dependency property.
Declaration
public static readonly BindableProperty TextInputLayoutSettingsProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for TextInputLayoutSettings dependency property. |
TrailingViewPositionProperty
Identifies the TrailingViewPosition dependency property.
Declaration
public static readonly BindableProperty TrailingViewPositionProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for TrailingViewPosition dependency property. |
TrailingViewProperty
Identifies the TrailingView dependency property.
Declaration
public static readonly BindableProperty TrailingViewProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for TrailingView dependency property. |
ValidMessageLabelTextStyleProperty
Identifies the ValidMessageLabelTextStyle dependency property.
Declaration
public static readonly BindableProperty ValidMessageLabelTextStyleProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for ValidMessageLabelTextStyle dependency property. |
Properties
Background
Gets or sets the background to the data form item layout which is used to render label and editor for the data field.
Declaration
public Brush Background { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.Brush | The default value is |
Examples
The below examples shows, how to set the Background property of DataFormItem in the SfDataForm.
See Also
DefaultLayoutSettings
Gets or sets the value of layout (holds label and editor) settings which is used to customize the label position, label width and editor width.
Declaration
public DataFormDefaultLayoutSettings DefaultLayoutSettings { get; set; }
Property Value
Type | Description |
---|---|
DataFormDefaultLayoutSettings | The default value is |
Remarks
The DefaultLayoutSettings property takes precedence when explicitly defined to particular editor otherwise where DefaultLayoutSettings will be applied to the editor.
Examples
The below examples shows, how to set the DefaultLayoutSettings property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm"
AutoGenerateItems="False">
</dataForm:SfDataForm>
See Also
EditorHeight
Gets or sets the height of the editor.
Declaration
public double EditorHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is |
Remarks
For Syncfusion.Maui.DataForm.DataFormMultilineTextEditor if the EditorHeight is explicitly set, the editor will expand to match the specified EditorHeight value, if text changed beyond EditorHeight, then the editor will expand based on text in both default and floating label layouts. For DataFormCustomItem if the height is mentioned in the custom view, the editor will expand to match the specified height added in both default and floating label layouts. Else, you can explicitly set the height using the EditorHeight property. For Syncfusion.Maui.DataForm.DataFormRadioGroupEditor height will be considered for each button in default layout. For the Default layout(Label and editor), the layout auto expands to the maximum size of the label and the editor height for the label position is left.
Examples
The below examples shows, how to set the height property of data form item.
EditorTextStyle
Gets or sets the style of editor text, that used to customize the text color, font, font size, font family and font attributes.
Declaration
public DataFormTextStyle EditorTextStyle { get; set; }
Property Value
Type | Description |
---|---|
DataFormTextStyle | The default value is |
Remarks
The EditorTextStyle property takes precedence when explicitly defined to particular editor otherwise where EditorTextStyle will be applied to the editor.
Examples
The below examples shows, how to set the EditorTextStyle property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm"
AutoGenerateItems="False">
</dataForm:SfDataForm>
See Also
ErrorLabelTextStyle
Gets or sets the style of error message label , that used to customize the text color, font, font size, font family and font attributes.
Declaration
public DataFormTextStyle ErrorLabelTextStyle { get; set; }
Property Value
Type | Description |
---|---|
DataFormTextStyle | The default value is |
Remarks
The ErrorLabelTextStyle property takes precedence when explicitly defined to particular editor otherwise where ErrorLabelTextStyle will be applied to the editor.
Examples
The below examples shows, how to set the ErrorLabelTextStyle property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm"
AutoGenerateItems="False">
</dataForm:SfDataForm>
See Also
FieldName
Gets or sets the editor's name in the data form.
Declaration
public string FieldName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is |
Examples
The below examples shows, how to use the FieldName property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm"
AutoGenerateItems="False">
<dataForm:SfDataForm.Items>
<dataForm:DataFormTextItem FieldName="UserName"/>
<dataForm:DataFormPasswordItem FieldName="Password"/>
</dataForm:SfDataForm.Items>
</dataForm:SfDataForm>
See Also
GroupName
Gets or sets the name of the group to the editor.
Declaration
public string GroupName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is |
Examples
The below examples shows, how to use the GroupName property of DataFormItem in the SfDataForm.
See Also
IsReadOnly
Gets or sets a value indicating whether editor can be enabled or disabled.
Declaration
public Nullable<bool> IsReadOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> | The default value is |
Remarks
The IsReadOnly property takes precedence when explicitly defined to particular editor otherwise where IsReadOnly will be applied to the editor.
Examples
The below examples shows, how to set the IsReadOnly property of DataFormItem in the SfDataForm.
See Also
IsValid
Gets a value indicating whether this DataFormItem is valid or not.
Declaration
public bool IsValid { get; }
Property Value
Type |
---|
System.Boolean |
ItemsOrderInRow
Gets or sets the editor’s position in a row.
Declaration
public int ItemsOrderInRow { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is |
Remarks
This property is applicable to only when the ColumnCount is greater than 1. The items on the data form are arranged in layout rows. Use the RowOrder property to specify the number of the layout row where the item should be displayed. Use the ItemsOrderInRow property to display multiple editors in a single row. Two items with the same RowOrder property value are placed in this row according to their ItemOrderInRow property values.
Examples
The below examples shows, how to set the ItemsOrderInRow property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm" AutoGenerateItems="False"
ColumnCount="2">
</dataForm:SfDataForm>
See Also
LabelText
Gets or sets the editor’s label text.
Declaration
public string LabelText { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is |
Remarks
If Label Text is not mentioned, the field name value will be considered as label text.
Examples
The below examples shows, how to use the LabelText property of DataFormItem in the SfDataForm.
See Also
LabelTextStyle
Gets or sets the style of editor label text, that used to customize the text color, font, font size, font family and font attributes.
Declaration
public DataFormTextStyle LabelTextStyle { get; set; }
Property Value
Type | Description |
---|---|
DataFormTextStyle | The default value is |
Remarks
The LabelTextStyle property takes precedence when explicitly defined to particular editor otherwise where LabelTextStyle will be applied to the editor.
Examples
The below examples shows, how to set the LabelTextStyle property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm"
AutoGenerateItems="False">
</dataForm:SfDataForm>
See Also
LayoutType
Gets or sets layout option.
Declaration
public Nullable<DataFormLayoutType> LayoutType { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<DataFormLayoutType> | The default value is |
Examples
The below examples shows, how to set the LayoutType property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm"
AutoGenerateItems="False">
<dataForm:DataFormTextItem FieldName="Name" LayoutType="TextInputLayout">
</dataForm:DataFormTextItem>
</dataForm:SfDataForm>
See Also
LeadingView
Gets or sets the view used as the editor's label for Default, and places it before the input view for TextInputLayout.
Declaration
public View LeadingView { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.View | The default value is |
Examples
The below examples shows, how to set the LeadingView property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm" AutoGenerateItems="False">
<dataForm:DataFormTextItem FieldName="Name">
<dataForm:DataFormTextItem.LeadingView>
<Label Text="F" FontSize="18" FontFamily="MauiSampleFontIcon" HeightRequest="24" VerticalTextAlignment="End" />
</dataForm:DataFormTextItem.LeadingView>
</dataForm:DataFormTextItem>
</dataForm:SfDataForm>
See Also
LeadingViewPosition
Gets or sets the value that determines whether to place the leading view within the layout of data form floating label layout.
Declaration
public TextInputLayoutViewPosition LeadingViewPosition { get; set; }
Property Value
Type | Description |
---|---|
TextInputLayoutViewPosition | The default value is Outside. |
Remarks
The LeadingViewPosition property is applicable only when LayoutType or LayoutType is TextInputLayout. The LeadingViewPosition property is not applicable when LayoutType or LayoutType is Default.
Examples
The below examples shows, how to set the LeadingViewPosition property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm" AutoGenerateItems="False">
<dataForm:DataFormTextItem FieldName="Name" ShowLeadingView="True" LeadingViewPosition="Inside" LayoutType="TextInputLayout">
<dataForm:DataFormTextItem.LeadingView>
<Label Text="F" FontSize="18" FontFamily="MauiSampleFontIcon" HeightRequest="24" VerticalTextAlignment="End" />
</dataForm:DataFormTextItem.LeadingView>
</dataForm:DataFormTextItem>
</dataForm:SfDataForm>
See Also
PlaceholderColor
Gets or sets the color of prompt string displayed or the water mark to provide hint for users in the editors.
Declaration
public Color PlaceholderColor { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Graphics.Color | The default value is |
Remarks
This property is applicable to only when the PlaceholderText is applied.
Examples
The below examples shows, how to use the PlaceholderColor property of DataFormItem in the SfDataForm.
See Also
PlaceholderText
Gets or sets the prompt string displayed or the water mark to provide hint for users in the editors.
Declaration
public string PlaceholderText { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is |
Examples
The below examples shows, how to use the PlaceholderText property of DataFormItem in the SfDataForm.
See Also
PropertyInfo
Gets the property info of the data field.
Declaration
public PropertyInfo PropertyInfo { get; }
Property Value
Type |
---|
System.Reflection.PropertyInfo |
ShowLabel
Gets or sets a value indicating whether to show the label to the editor.
Declaration
public bool ShowLabel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is |
Examples
The below examples shows, how to use the ShowLabel property of DataFormItem in the SfDataForm.
See Also
ShowLeadingView
Gets or sets a value indicating whether to show the leading view to the editor.
Declaration
public bool ShowLeadingView { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is |
Remarks
Use this ShowLeadingView property whether to display image as editor's label.
Examples
The below examples shows, how to set the ShowLeadingView property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm" AutoGenerateItems="False">
<dataForm:DataFormTextItem FieldName="Name" ShowLeadingView="True">
<dataForm:DataFormTextItem.LeadingView>
<Label Text="F" FontSize="18" FontFamily="MauiSampleFontIcon" HeightRequest="24" VerticalTextAlignment="End" />
</dataForm:DataFormTextItem.LeadingView>
</dataForm:DataFormTextItem>
</dataForm:SfDataForm>
See Also
ShowTrailingView
Gets or sets a value indicating whether to show or hide the trailing view of data form floating label layout.
Declaration
public bool ShowTrailingView { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is |
Remarks
The ShowTrailingView property is applicable only when LayoutType or LayoutType is TextInputLayout.
Examples
The below examples shows, how to set the ShowTrailingView property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm" AutoGenerateItems="False">
<dataForm:DataFormTextItem FieldName="Name" ShowTrailingView="True" LayoutType="TextInputLayout">
<dataForm:DataFormTextItem.TrailingView>
<Label Text="F" FontSize="18" FontFamily="MauiSampleFontIcon" HeightRequest="24" VerticalTextAlignment="End" />
</dataForm:DataFormTextItem.TrailingView>
</dataForm:DataFormTextItem>
</dataForm:SfDataForm>
See Also
TextInputLayoutSettings
Gets or sets text input layout settings.
Declaration
public TextInputLayoutSettings TextInputLayoutSettings { get; set; }
Property Value
Type | Description |
---|---|
TextInputLayoutSettings | The default value is |
Remarks
The TextInputLayoutSettings property is applicable only when LayoutType or LayoutType is TextInputLayout.
Examples
The below examples shows, how to set the TextInputLayoutSettings property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm" AutoGenerateItems="False">
<dataForm:DataFormTextItem FieldName="Name" LayoutType="TextInputLayout">
<dataForm:DataFormTextItem.TextInputLayoutSettings>
<dataForm:TextInputLayoutSettings ContainerType="Outlined"/>
</dataForm:DataFormTextItem.TextInputLayoutSettings>
</dataForm:DataFormTextItem>
</dataForm:SfDataForm>
See Also
TrailingView
Gets or sets a value for a view to place after input view of data form floating label layout.
Declaration
public View TrailingView { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.View | The default value is |
Remarks
The TrailingView property is applicable only when LayoutType or LayoutType is TextInputLayout.
Examples
The below examples shows, how to set the TrailingView property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm" AutoGenerateItems="False">
<dataForm:DataFormTextItem FieldName="Name" LayoutType="TextInputLayout">
<dataForm:DataFormTextItem.TrailingView>
<Label Text="F" FontSize="18" FontFamily="MauiSampleFontIcon" HeightRequest="24" VerticalTextAlignment="End" />
</dataForm:DataFormTextItem.TrailingView>
</dataForm:DataFormTextItem>
</dataForm:SfDataForm>
See Also
TrailingViewPosition
Gets or sets a value that determines whether to place the trailing view within the layout of data form floating label layout.
Declaration
public TextInputLayoutViewPosition TrailingViewPosition { get; set; }
Property Value
Type | Description |
---|---|
TextInputLayoutViewPosition | The default value is Outside. |
Remarks
The TrailingViewPosition property is applicable only when LayoutType or LayoutType is TextInputLayout.
Examples
The below examples shows, how to set the TrailingViewPosition property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm" AutoGenerateItems="False">
<dataForm:DataFormTextItem FieldName="Name" ShowTrailingView="True" TrailingViewPosition="Inside" LayoutType="TextInputLayout">
<dataForm:DataFormTextItem.TrailingView>
<Label Text="F" FontSize="18" FontFamily="MauiSampleFontIcon" HeightRequest="24" VerticalTextAlignment="End" />
</dataForm:DataFormTextItem.TrailingView>
</dataForm:DataFormTextItem>
</dataForm:SfDataForm>
See Also
ValidMessageLabelTextStyle
Gets or sets the style of valid message label, that used to customize the text color, font, font size, font family and font attributes.
Declaration
public DataFormTextStyle ValidMessageLabelTextStyle { get; set; }
Property Value
Type | Description |
---|---|
DataFormTextStyle | The default value is |
Remarks
The ValidMessageLabelTextStyle property takes precedence when explicitly defined to particular editor otherwise where ValidMessageLabelTextStyle will be applied to the editor.
Examples
The below examples shows, how to set the ValidMessageLabelTextStyle property of DataFormItem in the SfDataForm.
<dataForm:SfDataForm x:Name="dataForm"
AutoGenerateItems="False">
</dataForm:SfDataForm>
See Also
Methods
GetValue()
Gets the property value from business object.
Declaration
public object GetValue()
Returns
Type | Description |
---|---|
System.Object | The property value. |
OnBindingContextChanged()
Invokes on the binding context of the view changed.
Declaration
protected override void OnBindingContextChanged()
SetValue(Object)
Sets the property value to business object.
Declaration
public void SetValue(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The property value. |