Populating Items in Xamarin Chips

22 Aug 20221 minute to read

Chips can be populated with either business objects and SfChip. This section explain how to populate the chips control with business objects and SfChip.

Populating business objects as items

Business objects can be populated in Chips using the ItemsSource property.
Refer to this documentation to know more details about populating the chips control with list of employee details.

Populating SfChip as items

Chips control also provides support to create and set SfChip as item. It can be achieved using the Items property.

		<buttons:SfChipGroup Type="Action">
				<buttons:SfChip Text="Extra Small"/>
				<buttons:SfChip Text="Small"/>
				<buttons:SfChip Text="Medium"/>
				<buttons:SfChip Text="Large"/>
				<buttons:SfChip Text="Extra Large"/>
using Syncfusion.XForms.Buttons;
using Xamarin.Forms;

namespace Chips
	public partial class GettingStarted: ContentPage
		public GettingStarted()
			Grid grid = new Grid();
			var chipGroup = new SfChipGroup(){Type = SfChipsType.Action};
			chipGroup.Items.Add(new SfChip(){Text="Extra Small"});
			chipGroup.Items.Add(new SfChip(){Text="Small"});
			chipGroup.Items.Add(new SfChip(){Text="Medium"});
			chipGroup.Items.Add(new SfChip(){Text="Large"});
			chipGroup.Items.Add(new SfChip(){Text="Extra Large"});
			this.Content = grid;

Collection of items to chip group

See also

How to bind remote JSON data to Xamarin.Forms chip group (SfChipGroup)