Option to center a text in SfComboBox

Based on https://www.syncfusion.com/forums/183495/height-of-items-in-sfcombobox i center items in DropDown, but i cannot see option to do the same with placeholder space.

My code below 

Result : 

Image_1515_1700078606953



3 Replies 1 reply marked as answer

KP Kamalesh Periyasamy Syncfusion Team November 16, 2023 02:14 PM UTC

Hi Rafal Nowak,

 

We have validated your query  and we suggest a workaround to change placeholder text to center by applying horizontal text alignment  to center in input field as shown in the code snippet below. We have attached the sample for your reference. Please review the attached sample and feel free to reach out if you have any further queries.

 

Please refer the below code snippet for this:

public MainPage()

{

    InitializeComponent();

    var inputView = LocationPicker.Children[1] as Entry;

     inputView.HorizontalTextAlignment = TextAlignment.Center;

}

 

Note: By using this code, both the Placeholder and Text will be aligned at Center in SfComboBox input field.

 

Regards,
Kamalesh P


Attachment: ComboBox_41849933.zip

Marked as answer

RN Rafal Nowak replied to Kamalesh Periyasamy November 17, 2023 09:26 AM UTC

Hi Kamalesh Periyasamy,


Works perfect, thank you very much.


Regards, 
Rafal Nowak



PR Preethi Rajakandham Syncfusion Team November 20, 2023 05:33 AM UTC

Hi Rafal Nowak,

You're welcome. 

We are glad to know that the reported problem has been resolved. Please let us know if you require any further assistance on this, we will be happy to assist you. 

Regards,

Preethi R


Loader.
Up arrow icon