Syncfusion Xamarin.Forms Input controls for Data Form | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (174).NET Core  (29).NET MAUI  (207)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (215)BoldSign  (14)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (66)Flutter  (133)JavaScript  (221)Microsoft  (118)PDF  (81)Python  (1)React  (100)Streamlit  (1)Succinctly series  (131)Syncfusion  (914)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (36)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (147)Chart  (131)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (628)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (40)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (507)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (592)What's new  (332)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Syncfusion Xamarin.Forms Input Controls

Easily Create\Edit Data Entry Forms in Xamarin.Forms Using Edit\Input Controls

Introduction

Welcome to a walkthrough of creating data entry forms using some of Syncfusion’s input controls, like the built-in DataForm control, for the Xamarin.Forms platform.

The Xamarin.Forms DataForm control is used to display and edit the properties of any data object using a wide range of built-in editors for different data types. It simplifies the development of various forms such as login, reservation, and data entry.

Apart from the DataForm  control, Syncfusion Essential Studio for Xamarin provides other individual input controls that enable you to create your own data entry form as you like: Autocomplete, Button, Badge View, Chips, ComboBox, Picker, Calendar, Numeric Entry, NumericUpDown, Masked Entry, CheckBox, Radio Button, Range Slider, Rating, and Segmented Control that enable you to create your own data entry form to your specifications.

Use DataForm control if you have predefined models

If your application has a lot of forms and if you have predefined models, then we provide a DataForm control that can create forms based on your data objects, making the form creation process simple. DataForm helps you present data in a multitude of ways, like presenting a collection of model items in predefined layouts.

The following steps explain how to create a form with predefined models using DataForm:

Step 1: Import the control namespace “xmlns:dataForm=”clr-namespace:Syncfusion.XForms.DataForm;assembly=Syncfusion.SfDataForm.XForms” in a XAML page, create an instance of the DataForm control and add it as a view to the linear layout.

<ContentPage xmlns:dataForm="clr-namespace:Syncfusion.XForms.DataForm;assembly=Syncfusion.SfDataForm.XForms"
x:Class="GettingStarted.MainPage">
<dataForm:SfDataForm/>
</ContentPage>

Step 2: The DataForm is a data edit control, so create a data object to edit the data object. Here, the data object named ItemInfo is created with some properties.

public class ItemInfo
{
     public ItemInfo() { }
     public int TotalAmount { get; set; }
     public DateTime? Date { get; set; }
     public string Name { get; set; }
     public bool IsBillable { get; set; }
}

Step 3: Create a model repository class with the ItemInfo property initialized with required data in a new class file as shown in the following code example.

public class ViewModel
{
     public ItemInfo ItemInfo { get; set; }
     public ViewModel()
     {
          ItemInfo= new ItemInfo();
     }
}

Step 4: To populate the labels and editors in the data form, set the DataObject property.

<ContentPage xmlns:local="clr-namespace:GettingStarted"
xmlns:dataForm="clr-namespace:Syncfusion.XForms.DataForm;assembly=Syncfusion.SfDataForm.XForms"
x:Class="GettingStarted.MainPage">
     <ContentPage.BindingContext>
          <local:ViewModel/>
     </ContentPage.BindingContext>
     <dataForm:SfDataForm  DataObject="{Binding ItemInfo}"/>
</ContentPage>

 

Syncfusion’s Xamarin.Forms DataForm creates forms based on your data objects.

Syncfusion’s Xamarin.Forms DataForm

Syncfusion’s Xamarin.Forms input controls form modelless data forms

So far, we discussed how the Syncfusion’s Xamarin.Forms DataForm controls help to create predefined model data forms.  Now, let’s see how Syncfusion input controls greatly improve the data entry experience for your end users with rich features.

Fast and feature-rich Autocomplete

Syncfusion’s Xamarin.Forms Autocomplete control prompts users as they type with a list of suggestions to choose from, making data entry faster and less error-prone. For instance, in a form, users can pick a zip code by searching with this control.

The high-performance search engine can load and search through 100,000 items in less than a second. Typo-toleration functionality for custom searches, on-demand loading for effective data utilization, multiple selection with token representation, highlighting for matching text, and diacritic sensitivity are several other important features of this control.

Xamarin.Forms Autocomplete is used to pick a mail contact

Syncfusion’s Xamarin.Forms Autocomplete

How to add a Syncfusion input control into your data form

Creating a project from a Visual Studio template

Refer to this section of the Xamarin Getting Started guide to create a Xamarin.Forms application through Visual Studio.

Adding references from NuGet

Refer to our documentation for the steps to installing Essential Studio components in your solution.

Note: Refer to our documentation for the dependency assembly details for adding the Autocomplete control to your project. After the assembly reference has been added, an additional step is required for iOS and UWP projects.

Adding control initialization code

In the following steps, the necessary XAML code has been added to initialize the control.

Step 1: Include the SfAutoComplete namespace in the respective page.

<ContentPage xmlns:autocomplete="clr-namespace:Syncfusion.SfAutoComplete.XForms;assembly=Syncfusion.SfAutoComplete.XForms"
x:Class="GettingStarted.MainPage">
</ContentPage>

Step 2: Declare SfAutoComplete with the content page by defining the height as 40, since the address bar needs a 40-pixel height.

<ContentPage xmlns:autocomplete="clr-namespace:Syncfusion.SfAutoComplete.XForms;assembly=Syncfusion.SfAutoComplete.XForms"
x:Class="GettingStarted.MainPage">
     <autocomplete:SfAutoComplete HeightRequest="40"/>
</ContentPage>

Note: The previous steps are applicable to add all Syncfusion’s Xamarin.Forms input controls into a Xamarin.Forms application.

Adding suggestion items

Naturally, the Autocomplete control can be bound with a data source as well as direct string items.

<ContentPage xmlns:autocomplete="clr-namespace:Syncfusion.SfAutoComplete.XForms;assembly=Syncfusion.SfAutoComplete.XForms"
xmlns:ListCollection="clr-namespace:System.Collections.Generic;assembly=mscorlib"
x:Class="GettingStarted.MainPage">
     <autocomplete:SfAutoComplete HeightRequest="40">
          <autocomplete:SfAutoComplete.AutoCompleteSource>
               <ListCollection:List x:TypeArguments="x:String">
                    <x:String>Aqua</x:String>
                    <x:String>Blue</x:String>
                    <x:String>Indigo</x:String>
                    <x:String>Red</x:String>
                    <x:String>Purple</x:String>
               </ListCollection:List>
          </autocomplete:SfAutoComplete.AutoCompleteSource>
     </autocomplete:SfAutoComplete>
</ContentPage>

Advanced Button with toggle actions

The Xamarin.Forms Button is a custom button control with UI customization, toggle states, and theme support. You can set icons, background images, and corner edge radii as well as customize the appearance of different visual states using the visual state manager.

Syncfusion’s Xamarin.Forms Button is highly customizable.

Syncfusion’s Xamarin.Forms Button

Editable ComboBox

Xamarin.Forms ComboBox control is a data entry control that allows users to select options from a fixed list of items. The ComboBox is used to choose a country, either by opening the drop-down or simply typing beginning to type its name.

Syncfusion’s Xamarin.Forms ComboBox used to pick a country

Syncfusion’s Xamarin.Forms ComboBox

Versatile Picker

We even provide a versatile Picker control that can be used to pick from any type of list data. This determines the nature of the Picker as a date picker, time picker, language picker, color picker, etc. Intuitive multicolumn options support cascading selection. The Picker control is the only component that automatically generates its columns based on data source structure. In this form, the Picker control can provide a common UI to pick a date value.

Syncfusion’s Xamarin.Forms Picker  can be used to pick a language, date, and time.

Syncfusion’s Xamarin.Forms Picker

Lightweight calendar for date selection

Get precise date input using the powerful Calendar control. Users can navigate from month to year view.

Syncfusion’s Xamarin.Forms Calendar used to pick a date with calendar appearance.

Syncfusion’s Xamarin.Forms Calendar

Modernize entry using Text Input Layout

The Text Input Layout control informs users of the kind data that they are expected to enter and, if its wrong, alerts them with a validation message. It lets you add a password toggle icon to show or hide passwords; assistive labels such as floating labels; and hint, error, and help text on top of entry controls.

Syncfusion’s Xamarin.Forms Text Input Layout used to show floating labels.

Syncfusion’s Xamarin.Forms Text Input Layout

Numeric Entry with custom format

Restrict input to numeric values using the Numeric Entry control. The control adapts to the device culture based on the region.

Syncfusion’s Xamarin.Forms Numeric Entry accepts only numeric value

Syncfusion’s Xamarin.Forms Numeric Entry

Spin numbers with NumericUpDown

Use the NumericUpDown control to restrict numeric inputs with frequent steps. It behaves as a repeat button to increment or decrement a numeric value with a simple button click.

 Syncfusion’s Xamarin.Forms NumericUpDown used to select value from numeric range.

Syncfusion’s Xamarin.Forms NumericUpDown

Specify patterns using Masked Entry

Ensure that input conforms to specific patterns using the Masked Entry control by providing custom masks or regex that restrict user input to certain types of characters, like text for inputs such as telephone numbers, IP addresses, and product IDs.

Syncfusion’s Xamarin.Forms Masked Entry with respective input patterns.

Syncfusion’s Xamarin.Forms Masked Entry

Scrollable Segmented Control

Use Segmented Control to provide users an elegant interface for choosing from two or more contexts. The Xamarin.Forms Segmented Control can replace a traditional radio button.

Syncfusion’s Xamarin.Forms Segmented Control used to choose from two or more contexts.

Syncfusion’s Xamarin.Forms Segmented Control

Indeterminate switch with Segmented Control

On further customization of the Segmented Control, it can act as either a typical switch or an indeterminate switch with three states: on, off, and balanced.

Indeterminate switch with Syncfusion’s Xamarin.Forms Segmented Control.

Indeterminate switch with Syncfusion’s Xamarin.Forms Segmented Control

Feature-rich Range Slider

The Range Slider control allows users to select a value or range of values within the min and max range using an elegant interface.

Syncfusion’s Xamarin.Forms Range Slider to pick a value from a range.

Syncfusion’s Xamarin.Forms Range Slider

Group choices with Radio Button Group

The Radio Button control provides users an elegant interface to choose from two or more choices without occupying much space.

Syncfusion’s Xamarin.Forms Radio Button for single choice selection.

Syncfusion’s Xamarin.Forms Radio Button

Indeterminate CheckBox

Using CheckBox control, ensure all subchoices are selected or unselected by indicating with the indeterminate state when a collection of subchoices has both unselected and selected states.

Indeterminate state indicates subchoices state.

Syncfusion’s Xamarin.Forms CheckBox

Custom view Rating

Instead of just a traditional star-like appearance, you can customize our Xamarin.Forms Rating control to improve the user experience by building a reaction or mood interface like those in social network apps such as Facebook.

Syncfusion’s Xamarin.Forms Rating control used as reaction or mood interface.

Syncfusion’s Xamarin.Forms Rating control

Summary

In this blog post, we have walked through the Syncfusion Xamarin.Forms input controls used to create forms. We’ve seen how easily the DataForm control itself creates an object-based data form where the application needs a lot of forms. We invite you to check out our Xamarin.Forms controls.  You can always download our free evaluation to see all these controls in action. You can also explore our samples available on Google Play and learn about advanced features in our documentation.

Tags:

Share this post:

Comments (1)

[…] Easily Create Data Entry Forms in Xamarin.Forms using Syncfusion Input Controls (Selva Ganapathy K) […]

Comments are closed.

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed