Articles in this section
Category / Section

How to load the Entry control in xamarin.forms listview item?

ListView allows you load any editable view such as entry, editor, and search bar. To retain the typed value when scrolling, set binding to the Text property.

xaml

<ContentPage xmlns:syncfusion="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms">
    <ContentPage.Content>
        <syncfusion:SfListView x:Name="listView"
                               ItemSize="70" 
                               ItemsSource="{Binding ContactsInfo}">
            <syncfusion:SfListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <ViewCell.View>
                            <StackLayout>
                                <Entry Placeholder="Type text here" HeightRequest="70" Text="{Binding  Entrytext}" />
                            </StackLayout>
                        </ViewCell.View>
                    </ViewCell>
                </DataTemplate>
            </syncfusion:SfListView.ItemTemplate>
        </syncfusion:SfListView>
    </ContentPage.Content>
</ContentPage>

 

C#

public class ListViewContactsInfo : INotifyPropertyChanged
{
    private string entrytext;
    public ListViewContactsInfo()
    {
 
    }
 
    public string Entrytext
    {
        get { return this. entrytext; }
        set
        {
            this. entrytext = value;
            RaisePropertyChanged("Entrytext");
        }
    }
    public event PropertyChangedEventHandler PropertyChanged;
 
    private void RaisePropertyChanged(String name)
    {
        if (PropertyChanged != null)
            this.PropertyChanged(this, new PropertyChangedEventArgs(name));
    }
 
}

 

Sample link: Load entry in listview

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied