Class DropDownListBase
Represent a base class which is used to create a list control like SfComboBox or SfAutocomplete. These controls are used to selected item(s) from the suggestions displayed in drop down.
Implements
Inherited Members
Namespace: Syncfusion.Maui.Inputs.DropDownControls
Assembly: Syncfusion.Maui.Inputs.dll
Syntax
public abstract class DropDownListBase : SfDropdownEntry, IDrawableLayout, IDrawable, IAbsoluteLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, IVisualTreeElement, ITouchListener, ITextElement, IKeyboardListener
Constructors
DropDownListBase()
Initializes a new instance of the DropDownListBase class.
Declaration
public DropDownListBase()
Fields
DisplayMemberPathProperty
Identifies DisplayMemberPath bindable property.
Declaration
public static readonly BindableProperty DisplayMemberPathProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for the DisplayMemberPath bindable property. |
ItemsSourceProperty
Identifies ItemsSource bindable property.
Declaration
public static readonly BindableProperty ItemsSourceProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for the ItemsSource bindable property. |
ItemTemplateProperty
Identifies ItemTemplate bindable property.
Declaration
public static readonly BindableProperty ItemTemplateProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for the ItemTemplate bindable property. |
SelectedItemProperty
Identifies SelectedItem bindable property.
Declaration
public static readonly BindableProperty SelectedItemProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for the SelectedItem bindable property. |
SelectedValuePathProperty
Identifies SelectedValuePath bindable property.
Declaration
public static readonly BindableProperty SelectedValuePathProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for the SelectedValuePath bindable property. |
SelectedValueProperty
Identifies SelectedValue bindable property.
Declaration
public static readonly BindableProperty SelectedValueProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for the SelectedValue bindable property. |
TextMemberPathProperty
Identifies TextMemberPath bindable property.
Declaration
public static readonly BindableProperty TextMemberPathProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for the TextMemberPath bindable property. |
TextProperty
Identifies Text bindable property.
Declaration
public static readonly BindableProperty TextProperty
Field Value
Type | Description |
---|---|
Microsoft.Maui.Controls.BindableProperty | The identifier for the Text bindable property. |
Properties
DisplayMemberPath
Gets or sets the name or path of the property that is displayed for each data item in the drop down.
Declaration
public string DisplayMemberPath { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is |
Remarks
In non-editable mode, search will be performed using DisplayMemberPath
when the popup is opened.
If TextMemberPath
is null
or string.Empty
, then searching and displaying the selected value in selection box area will be based on DisplayMemberPath
.
If both TextMemberPath
and DisplayMemberPath
properties are null
or string.Empty
, then searching and displaying the selected value will be based on value received from object.ToString
.
ItemsSource
Gets or sets an object source used to generate the content of the control.
Declaration
public object ItemsSource { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value is |
ItemTemplate
Gets or sets the data template for dropdown item in dropdown view.
Declaration
public DataTemplate ItemTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.Maui.Controls.DataTemplate | The default value is |
SelectedItem
Gets or sets the selected item.
Declaration
public object SelectedItem { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value is |
Remarks
Editor will show PlaceHolderText
when no item is selected.
SelectedValue
Gets the value of the SelectedItem
obtained using SelectedValuePath
.
Declaration
public object SelectedValue { get; }
Property Value
Type | Description |
---|---|
System.Object | The default value is |
Remarks
The value of the selected item.
SelectedValuePath
Gets or sets the property path that is used to get the SelectedValue
property of the SelectedItem
property.
Declaration
public string SelectedValuePath { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is |
Remarks
If SelectedValuePath
is null
, SelectedValue
will be received from object.ToString
.
Text
Gets the text that is used to display in the text box portion of the control.
Declaration
public string Text { get; }
Property Value
Type | Description |
---|---|
System.String | The default value is |
Remarks
This property does not have effect in non-editable mode.
TextMemberPath
Gets or sets the property path that is used to display the selected value in the text box portion or non-editable display area.
Declaration
public string TextMemberPath { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is |
Remarks
In editable mode, search will be performed using TextMemberPath
.
In non-editable mode, search will be performed using TextMemberPath
when the popup is not opened.
In non-editable mode, search will be performed using DisplayMemberPath
when the popup is opened.
If TextMemberPath
is null
or string.Empty
, then searching and displaying the selected value in selection box area will be based on DisplayMemberPath
.
If both TextMemberPath
and DisplayMemberPath
properties are null
or string.Empty
, then searching and displaying the selected value will be based on value received from object.ToString
.
Methods
OnHandlerChanged()
Handler changed method.
Declaration
protected override void OnHandlerChanged()
Overrides
OnPropertyChanged(String)
PropertyChanged method.
Declaration
protected override void OnPropertyChanged(string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName |
Events
Completed
The completed event gets raised when pressing enter key or return key after the text is entered in the input field. It is applicable only for editable modes.
Declaration
public event EventHandler Completed
Event Type
Type | Description |
---|---|
System.EventHandler |
SelectionChanged
Occurs when the current selection is changed.
Declaration
public event EventHandler<SelectionChangedEventArgs> SelectionChanged
Event Type
Type | Description |
---|---|
System.EventHandler<SelectionChangedEventArgs> |