We can add child controls to Listview in Xamarin.Forms. In order to see the child control in action we will take an example. Let’s display a list of data in the Listview and perform delete option on the list data per row basis.
Since we need to add multiple columns in the list view, we need to use the DataTemplate to define the custom view. Let’s use a model class to assign the data to the custom view.
|
public class Item { public string ItemName { get; set; } public string ItemDetails { get; set; } } |
We will use XAML to design a Listview

In the above XAML, we have used the StackLayout as the parent container for the child views. It contains a Label and a Listview. UI Control is ready.
Time to add event to the child control
We will replace the Button control in the above XAML with the following line
Like this:
Like Loading...
Categories: Android, Cross Platform Mobile App, CSharp, iOS, Visual Studio, Windows Phone, Xamarin, XAML