- Home
- Forum
- Xamarin.Forms
- SfComboBox Dropdown truncates text
SfComboBox Dropdown truncates text
How can we avoid SfComboBox drop down from truncating text.
Attachment: Simulator_Screen_Shot__iPhone_X__20181227_at_16.20.14_2a457742.rar
Attachment: Simulator_Screen_Shot__iPhone_X__20181227_at_16.20.14_2a457742.rar
SIGN IN To post a reply.
3 Replies
DR
Dhanasekar R
Syncfusion Team
December 31, 2018 12:35 PM UTC
Hi Sadhik,
Greetings from Syncfusion.
You can avoid the truncating text on SfComboBox by using the ItemTemplate to the control.
|
<combobox:SfComboBox.ItemTemplate> <DataTemplate> <StackLayout Orientation="Horizontal"> <Label Text="{Binding}" HeightRequest="100" /> </StackLayout> </DataTemplate> </combobox:SfComboBox.ItemTemplate> |
We have prepared a sample for the same, please download the same from the link given below.
Sample link: ComboBoxSample
Please let us know if you have any further clarifications on this.
Regards,
Dhanasekar
SA
Sadhik
January 2, 2019 10:08 AM UTC
Thank you I managed to show full text using specif heights as pointed out thank you.
Attachment: Simulator_Screen_Shot__iPhone_XS__20190102_at_14.07.20_5a3ed70f.zip
<combobox:SfComboBox.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="2,2,2,2">
<StackLayout.HeightRequest>
<OnPlatform x:TypeArguments="x:Double">
<OnPlatform.WinPhone>
<OnIdiom x:TypeArguments="x:Double" Phone="60" Tablet="40" />
</OnPlatform.WinPhone>
<OnPlatform.Android>
<OnIdiom x:TypeArguments="x:Double" Phone="60" Tablet="40" />
</OnPlatform.Android>
<OnPlatform.iOS>
<OnIdiom x:TypeArguments="x:Double" Phone="60" Tablet="40" />
</OnPlatform.iOS>
</OnPlatform>
</StackLayout.HeightRequest>
<Label Text="{Binding Text}" VerticalOptions="FillAndExpand" VerticalTextAlignment="Center" YAlign="Center">
<Label.FontSize>
<OnPlatform x:TypeArguments="x:Double">
<OnPlatform.WinPhone>
<OnIdiom x:TypeArguments="x:Double" Phone="16" Tablet="18" />
</OnPlatform.WinPhone>
<OnPlatform.Android>
<OnIdiom x:TypeArguments="x:Double" Phone="14" Tablet="17" />
</OnPlatform.Android>
<OnPlatform.iOS>
<OnIdiom x:TypeArguments="x:Double" Phone="16" Tablet="18" />
</OnPlatform.iOS>
</OnPlatform>
</Label.FontSize>
<Label.WidthRequest>
<OnPlatform x:TypeArguments="x:Double">
<OnPlatform.Android>
<OnIdiom x:TypeArguments="x:Double" Phone="70"/>
</OnPlatform.Android>
</OnPlatform>
</Label.WidthRequest>
<Label.HeightRequest>
<OnPlatform x:TypeArguments="x:Double">
<OnPlatform.WinPhone>
<OnIdiom x:TypeArguments="x:Double" Phone="59" Tablet="39" />
</OnPlatform.WinPhone>
<OnPlatform.Android>
<OnIdiom x:TypeArguments="x:Double" Phone="59" Tablet="39" />
</OnPlatform.Android>
<OnPlatform.iOS>
<OnIdiom x:TypeArguments="x:Double" Phone="59" Tablet="39" />
</OnPlatform.iOS>
</OnPlatform>
</Label.HeightRequest>
</Label>
<BoxView Opacity=".7" BackgroundColor="LightGray" HeightRequest="1"></BoxView>
</StackLayout>
</ViewCell>
</DataTemplate>
</combobox:SfComboBox.ItemTemplate>
Attachment: Simulator_Screen_Shot__iPhone_XS__20190102_at_14.07.20_5a3ed70f.zip
DR
Dhanasekar R
Syncfusion Team
January 2, 2019 12:02 PM UTC
Thanks for the update.
Glad that the issue has been resolved. Please let us know if any further assistance on this.
Regards,
Dhanasekar
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
SA Sadhik
- Dec 27, 2018 12:23 PM UTC
- Jan 2, 2019 12:02 PM UTC