menu

Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfPicker - Xamarin.Android API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfPicker

    A customized view for picking an element in a list.

    Inheritance
    System.Object
    SfPicker
    Namespace: Syncfusion.Android.DataForm.Editors
    Assembly: Syncfusion.SfDataForm.Android.dll
    Syntax
    public class SfPicker : ViewGroup

    Constructors

    SfPicker(Context)

    Initializes a new instance of the SfPicker.

    Declaration
    public SfPicker(Context context)
    Parameters
    Type Name Description
    Android.Content.Context context

    Context of the view

    SfPicker(Context, IAttributeSet)

    Initializes a new instance of the SfPicker.

    Declaration
    public SfPicker(Context context, IAttributeSet attributeSet)
    Parameters
    Type Name Description
    Android.Content.Context context

    Context of the view

    Android.Util.IAttributeSet attributeSet

    Required attributes set

    SfPicker(Context, IAttributeSet, Int32)

    Initializes a new instance of the SfPicker.

    Declaration
    public SfPicker(Context context, IAttributeSet attributeSet, int defStyle)
    Parameters
    Type Name Description
    Android.Content.Context context

    Context of the view

    Android.Util.IAttributeSet attributeSet

    Required attributes set

    System.Int32 defStyle

    Default style attribute.

    SfPicker(IntPtr, JniHandleOwnership)

    Initializes a new instance of the SfPicker.

    Declaration
    protected SfPicker(IntPtr javaReference, JniHandleOwnership transfer)
    Parameters
    Type Name Description
    System.IntPtr javaReference

    Java Native Interface object reference.

    Android.Runtime.JniHandleOwnership transfer

    A Android.Runtime.JniHandleOwnership indicating how to handle.

    Properties

    DisplayMemberPath

    Gets or sets the display member path of the picker.

    Declaration
    public string DisplayMemberPath { get; set; }
    Property Value
    Type
    System.String

    Enabled

    Returns a value indicating whether SfPicker is enabled or not.

    Declaration
    public override bool Enabled { get; set; }
    Property Value
    Type
    System.Boolean

    ItemsSource

    Gets or sets the ItemsSource of the picker.

    Declaration
    public IEnumerable ItemsSource { get; set; }
    Property Value
    Type Description
    System.Collections.IEnumerable

    The data source for the picker.

    SelectedIndex

    Gets or sets the selected index of the picker.

    Declaration
    public int SelectedIndex { get; set; }
    Property Value
    Type
    System.Int32

    SelectedItem

    Gets or sets the selected item of the picker.

    Declaration
    public object SelectedItem { get; set; }
    Property Value
    Type
    System.Object

    TextAlignment

    Gets or sets the text alignment of the picker.

    Declaration
    public GravityFlags TextAlignment { get; set; }
    Property Value
    Type
    Android.Views.GravityFlags

    TextColor

    Gets or sets the text color of the picker.

    Declaration
    public Color TextColor { get; set; }
    Property Value
    Type
    Android.Graphics.Color

    Title

    Gets or sets the title of the picker.

    Declaration
    public string Title { get; set; }
    Property Value
    Type Description
    System.String

    The title.

    ValueMemberPath

    Gets or sets the value member path of the picker.

    Declaration
    public string ValueMemberPath { get; set; }
    Property Value
    Type
    System.String

    Methods

    Dispose(Boolean)

    Releases the unmanaged resources used by the component and optionally releases the managed resources.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    if true - release both managed and unmanaged resources; if false - release only unmanaged resources.

    FindFocus()

    Find the view in the hierarchy rooted at this view that currently has focus.

    Declaration
    public override View FindFocus()
    Returns
    Type Description
    Android.Views.View

    The view

    OnAttachedToWindow()

    Notifies when view is attached to window.

    Declaration
    protected override void OnAttachedToWindow()

    OnDetachedFromWindow()

    Notifies when view is detached from window.

    Declaration
    protected override void OnDetachedFromWindow()

    OnLayout(Boolean, Int32, Int32, Int32, Int32)

    Layout the children in the view. Derived classes with children should override this method and call layout on each of their children.

    Declaration
    protected override void OnLayout(bool changed, int l, int t, int r, int b)
    Parameters
    Type Name Description
    System.Boolean changed

    True if the size of the view is changed, otherwise false.

    System.Int32 l

    Left position, relative to parent

    System.Int32 t

    Top position, relative to parent

    System.Int32 r

    Right position, relative to parent

    System.Int32 b

    Bottom position, relative to parent

    OnMeasure(Int32, Int32)

    Raises the measure event.

    Declaration
    protected override void OnMeasure(int widthMeasureSpec, int heightMeasureSpec)
    Parameters
    Type Name Description
    System.Int32 widthMeasureSpec

    Width measure spec.

    System.Int32 heightMeasureSpec

    Height measure spec.

    SetPadding(Int32, Int32, Int32, Int32)

    Set padding for the child view.

    Declaration
    public override void SetPadding(int left, int top, int right, int bottom)
    Parameters
    Type Name Description
    System.Int32 left

    Left position, relative to child

    System.Int32 top

    Top position, relative to child

    System.Int32 right

    Right position, relative to child

    System.Int32 bottom

    Bottom position, relative to child

    Events

    SelectedIndexChanged

    Occurs when selected index of SfPicker is changed.

    Declaration
    public event EventHandler SelectedIndexChanged
    Event Type
    Type
    System.EventHandler
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved