Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: Aligning Items Horizontally to Start in ListPicker Spinner
description: Learn how to align items in the UI for .NET MAUI ListPicker spinner to the left horizontally (Start) instead of center.
type: how-to
page_title: How to Set Horizontal Alignment for Spinner Items in RadListPicker
meta_title: How to Set Horizontal Alignment for Spinner Items in RadListPicker
slug: align-items-horizontally-start-listpicker-spinner
tags: listpicker, ui for .net maui, alignment, itemstyle, selecteditemstyle
res_type: kb
---

## Environment

| Version | Product | Author |
| --- | --- | ---- |
| 11.1.0 | Telerik UI for .NET MAUI ListPicker | [Dobrinka Yordanova](https://www.telerik.com/blogs/author/dobrinka-yordanova) |

## Description

I want to align items in the spinner of the [UI for .NET MAUI ListPicker](https://www.telerik.com/maui-ui/documentation/controls/listpicker/overview) horizontally to the left (`Start`) instead of center.

This knowledge base article also answers the following questions:
- How do I change the horizontal alignment of spinner items in `RadListPicker`?
- How can I customize the alignment of items in the ListPicker component?
- How do I set the spinner items to start alignment in UI for .NET MAUI ListPicker?

## Solution

To align spinner items horizontally to the left (`Start`), define custom styles for `ItemStyle` and `SelectedItemStyle`. Apply these styles to the `ItemStyle` and `SelectedItemStyle` properties of the `RadListPicker` component.

1. Define a custom `Style` for the spinner items in the `Resources` section. Set the `HorizontalOptions` property to `Start`.

```xml
<Style x:Key="MySpinnerItemStyle" TargetType="telerik:SpinnerItemView">
<Setter Property="HorizontalOptions" Value="Start" />
</Style>
```

2. Apply the defined style to both `ItemStyle` and `SelectedItemStyle` properties of the `RadListPicker`.

```xml
<VerticalStackLayout>
<telerik:RadListPicker
ItemTemplate="{StaticResource itemTemplate}"
ItemStyle="{StaticResource MySpinnerItemStyle}"
SelectedItemStyle="{StaticResource MySpinnerItemStyle}"
ItemLength="40"
SelectedItem="{Binding SelectedCity, Mode=TwoWay}"
ItemSpacing="4"
ItemsSource="{Binding Items}"
DisplayMemberPath="Name"
x:Name="listPicker"
AutomationId="listPicker">
</telerik:RadListPicker>
</VerticalStackLayout>
```

Ensure the `itemTemplate` is defined in your resources and correctly bound to the data source.

## See Also

- [UI for .NET MAUI ListPicker Documentation](https://www.telerik.com/maui-ui/documentation/controls/listpicker/overview)
- [Customizing the Spinner ItemView in ListPicker](https://www.telerik.com/maui-ui/documentation/controls/listpicker/styling/styling)