Telerik Forums
UI for Xamarin Forum
1 answer
20 views

Hi,

I need to show suggestios when user focues on control or deletes text completely but this is not working as expected. My custom filter function already retruns data properly for empty search strings.

This is my TextCahnged event implemtation:

        private void usersAutoCompleteView_TextChanged(object sender, TextChangedEventArgs e)
        {
            var control = (RadAutoCompleteView)sender;
            if (string.IsNullOrEmpty(e.NewTextValue) && !string.IsNullOrEmpty(e.OldTextValue))
            {
                control.ShowSuggestions();
            }
        }

And this is my Focused event implementation:

        private void usersAutoCompleteView_Focused(object sender, FocusEventArgs e)
        {
            var control = (RadAutoCompleteView)sender;
            if (string.IsNullOrEmpty(control.SearchText))
            {
                control.ShowSuggestions();
            }
        }

I am also using SuggestionItemSelected event but is really simple: 
      private void usersAutoCompleteView_SuggestionItemSelected(object sender, Telerik.XamarinForms.Input.AutoComplete.SuggestionItemSelectedEventArgs e)
      {
          MyUser = (e.DataItem as MyModel).User;
      }

If I use Focused for showing Suggestions everything works fine, but when I added TextChanged nothings works as shoud:

1) Suggestion menu is never shown from TextChanged event

2) When I select Item from Suggsetion menu, text on the control gets immediately deleted (Text changed is getting called again with empty NewTextValue)

3) When I remove usage for TextChanged  event misbehaviour is still there. I need to clean whole build/restart VS/emulator to get it running again.

 

How should I achieve this functionality? It should be simple, for me it's looks like a common scenario

 

 

 

Didi
Telerik team
 answered on 08 Jan 2024
1 answer
26 views

Hi,

I am trying to change cursor color and border when AutoCompleteView is in Focus. How to do this? I can't find any renderer for this control in Telerik.XamarinForms.InputRenderer Namespace

Didi
Telerik team
 answered on 21 Dec 2023
19 answers
1.1K+ views

I keep running into:
Java.Lang.RuntimeException: Font asset not found Fonts/telerikfont.ttf

When trying to access any page with an AutoCompleteView.
I'm not sure why this started happening. This used to work fine and I never had to include any sort of Telerik fonts in my project, nor do I reference any. I tried downloading the font and including it where it wanted (Assets/Fonts/telerikfont.ttf) and it still barks at me as if it doesn't see it.

 

othmane
Top achievements
Rank 1
Iron
 answered on 11 May 2023
1 answer
132 views
please, how I can fix this issue? On the attached files you can see the Xamarin versions (with red has marked works version for the Xamarin.).
Didi
Telerik team
 answered on 04 Aug 2022
1 answer
56 views

Hi, I am using remote search and I need to show all elements after the Focused when the Text is empty (after focused I can get ItemsSource but the Suggestions PopUp is empty) !!! How can I do that?

Thank you...

Didi
Telerik team
 answered on 03 Aug 2022
0 answers
130 views

Hi Support,

I have a RadAutoCompleteView (see below definitions) and everything works except when the item is too long and it spans 2 rows in the result view. When user selects this long item and the drop down is closed, the selected item text is right aligned in the control. For example, the item shows like this in the drop down box:

1st line - Nursing and residential care facilities

2nd line - and long term care homes

User selects this item and returns to the control, they only see:

"facilities and long term care homes". User will need to press the home button in order to go to the start of the text. 

How do I code it so that the text is automatically left justified once returned from the result view into the control? Please help.

  <telerikInput:RadAutoCompleteView x:Name="MainAutoCompleteSectors" 
                                                              HeightRequest="35"
                                                              NoResultsMessage="No results." 
                                                              BorderThickness="1"
                                                              BorderColor="Silver"
                                                              SuggestionViewHeight="150"
                                                              ItemsSource="{Binding Sectors}"
                                                              TextSearchPath="CombinedName" 
                                                              BackgroundColor="White"
                                                              SuggestMode="Suggest"
                                                              CompletionMode="Contains" 
                                                              Watermark="Start typing here to start search..."
                                                              WatermarkTextColor="Black"
                                                              TextChanged="AutoCompleteSectors_TextChanged"
                                                              FontSize="12"
                                                              SearchThreshold="2"
                                                              TextColor="Black"
                                                              SuggestionItemTextColor="Black"
                                                              SuggestionItemSelected="Handle_SuggestionSectorItemSelected"
                                                              HorizontalOptions="FillAndExpand">
                                            <telerikInput:RadAutoCompleteView.SuggestionItemTemplate>
                                                <DataTemplate>
                                                    <ViewCell>
                                                        <autoCompleteView:SuggestionItemLabel TextColor="Black"
                                                            Padding="5,0"
                                                            HighlightTextColor="{StaticResource OrangeTextColor}"
                                                            UnformattedText="{Binding CombinedName}"
                                                            HighlightText="{Binding Source={x:Reference MainAutoCompleteSectors}, Path=Text}"/>
                                                    </ViewCell>
                                                </DataTemplate>
                                            </telerikInput:RadAutoCompleteView.SuggestionItemTemplate>

                                        </telerikInput:RadAutoCompleteView>

Vivian
Top achievements
Rank 1
Iron
 asked on 16 Jul 2021
1 answer
89 views

Hi, 

I'm trying to change the color of telerikInput:RadAutoCompleteView close icon, default it's dark,

I need to assign a color to it, can anyone help me

 

7 answers
125 views

So I am getting the "selected item" like so 

 

<input:RadAutoCompleteView.Behaviors>
     <xct:EventToCommandBehavior     Command="{Binding CommandEquipmentListItemSelected}" EventName="SuggestionItemSelected" />
</input:RadAutoCompleteView.Behaviors>

 

Then in my view model I cast it like so ...

if (arg is null) return;
                   var tmpRadRadAutoCompleteView = arg as SuggestionItemSelectedEventArgs;
 
                   if (tmpRadRadAutoCompleteView.DataItem is not null)
                   {
                       JCJob job = (JCJob)tmpRadRadAutoCompleteView.DataItem;

 

Which works fine ... until .. the user hit's the return key on the keyboard ... 

It then fires the command again and selects (passes in) the first item in the list .... 

Obviously this is not desired behavior .... 

 

Stephen
Top achievements
Rank 1
Veteran
 answered on 05 Apr 2021
1 answer
108 views

Hi,

I am using the AutoCompleteView in a Xamarin.Forms application running on iOS. The device is set to Dark Mode however I have set SuggestionViewBackgroundColor to White, however the SuggestionView still has a black background. I am running v2020.2.624.1.

Is this corrected in a later version of the library or do I need to use another approach to set the SuggestionViewBackgroundColor?

Kind regards,

Denise

Didi
Telerik team
 answered on 15 Oct 2020
4 answers
65 views

Hi, I have just begun using RadAutoCompleteView, and now I am looking for a way to set its selected items (tokens) in code-behind when I am going to open my entity's detail page in edition mode.

 

P.s. I am not using MVVM architecture and setting my control's ItemsSource programmatically:

Class:
public class Activity

    public string Id { get; set; }
    public List<string> ProductIds { get; set; }
}

ItemsSource: SomeListOfProducts.

 

What I'm going to do:

For each productId in ProductIds, I add a token to my RadAutoCompleteView that: token = SomeListOfProducts.Single(x => x.Id == productId).

Mehdi
Top achievements
Rank 1
Veteran
 answered on 17 Aug 2020
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?