We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfAutoComplete property 'DropDownItemFontFamily' not being set.

I've been trying to set the property `DropDownItemFontFamily` in the SfAutoComplete in my `App.xaml`.
But it seems to not get it. No matter if I set it as a `StaticResource` or a `DynamicResource`.

Code:
App.xaml:
```
<Application.Resources>
        <ResourceDictionary>
<OnPlatform x:Key="MontserratBoldItalic" x:TypeArguments="x:String">
                <On Platform="iOS" Value="Montserrat-BoldItalic" />
                <On Platform="Android" Value="Montserrat-BoldItalic.otf#Bold Italic" />
            </OnPlatform>
        </ResourceDictionary>

<Style ApplyToDerivedTypes="True" TargetType="{x:Type sfAutoComplete:SfAutoComplete}">
            <Setter Property="DropDownBackgroundColor" Value="{StaticResource PrimaryColor}" />
            <Setter Property="DropDownBorderColor" Value="{StaticResource ButtonBorderColor}" />
            <Setter Property="DropDownTextColor" Value="White" />
            <Setter Property="DropDownItemFontFamily" Value="{DynamicResource MontserratBoldItalic}" />
            <Setter Property="ShowSuggestionsOnFocus" Value="True" />
            <Setter Property="SuggestionBoxPlacement" Value="Bottom" />
            <Setter Property="SuggestionMode" Value="StartsWith" />
            <Setter Property="TextColor" Value="White" />
            <Setter Property="FontFamily" Value="{DynamicResource MontserratBoldItalic}" />
        </Style>
...
    </Application.Resources>
```
Not even setting in the the view seems to do it.
```
<sfAutoComplete:SfAutoComplete
                    x:Name="autoCompleteType"
                    DataSource="{Binding CategoriesList}"
                    DropDownItemFontFamily="{StaticResource MontserratBoldItalic}"
                    Text="{Binding Type}"
                    ValueChanged="Handle_ValueChanged" />
```

What am i doing wrong?

1 Reply

HM Hemalatha Marikumar Syncfusion Team December 10, 2019 08:44 AM UTC

Hi Alberto, 
  
Greeting from Syncfusion. 
  
We have validated your query and prepared a sample based on requirement using Montserrat-BoldItalic.otf . We were unable to reproduce the reported issue. Please find the tested sample from link below. 
  
  
Code Snippet [XAML] : App.XAML 
 
<Application.Resources> 
        <ResourceDictionary> 
            <OnPlatform x:TypeArguments="x:String" 
                        x:Key="customfontfamily" 
                        iOS="Montserrat-BoldItalic" 
                        Android="Montserrat-BoldItalic.otf" 
                        WinPhone="Assets/Montserrat-BoldItalic.otf#Montserrat" /> 
        </ResourceDictionary> 
    </Application.Resources> 
 
 
 Code Snippet [XAML] : MainPage.XAML 
 
<autocomplete:SfAutoComplete x:Name="autoComplete" 
                                     SuggestionMode="Contains" 
                                     FontFamily="{StaticResource customfontfamily}" 
                                     DropDownItemFontFamily="{StaticResource customfontfamily}" 
                                     DataSource="{Binding ItemsCollection}" 
                                     /> 
 
 
 
 
Note: 
  
Please ensure whether the font files are included in the Info.plist file (fonts that are provided by application, UIAppFonts, or key) in iOS platform. 
   
Please check above sample and ensure whether the reported issue has been occurred or not. If still occurs with provided sample, please update us by modifying the sample to replicate the issue which will more helpful for us to analyze further and provide a better solution. 
 
Regards, 
Hemalatha M. 


Loader.
Live Chat Icon For mobile
Up arrow icon