RadAutoCompleBox Value is not present in Itemsource

2 posts, 0 answers
  1. ali
    ali avatar
    5 posts
    Member since:
    Jan 2019

    Posted 26 Jan 2019 Link to this post


    I have a question regarding autocompletebox component. I would like to display an icon right at the cell textbox in GridView if the entered value is not present in the itemsource. Can one solve this over binding? Which is the best way to do that?

                            <DataTemplate >
                                <telerik:RadAutoCompleteBox DisplayMemberPath="Name"
                                                            SearchText="{Binding Path=Name, Mode=TwoWay}"
                                                            BoxesItemStyle="{StaticResource RadAutoCompleteBoxStyle}"
                                                            NoResultsContent="{x:Static resources:Translations.lbl_NoMatches}"
    ItemsSource="{Binding Path=DataContext.Project.Names,
    RelativeSource={RelativeSource AncestorType=telerik:RadGridView}}">

                                        <i:EventTrigger EventName="LostFocus">
    Command="{Binding RelativeSource={RelativeSource FindAncestor,
                                                                    CommandParameter="{Binding Path=.}"/>

  2. Dinko
    Dinko avatar
    1109 posts

    Posted 30 Jan 2019 Link to this post

    Hi ali,

    Thank you for the provided code snippet.

    You could achieve this behavior by implementing custom filtering behavior and create a bool property. Then you can bind this property to a visibility of the icon on the right side of the cell. Setting this property to Visible or Collapse will depends on the result returned inside the overridden FindMatchingItems method. I have prepared a sample project which demonstrates this. I need to point that this is a custom solution and may not work in all cases. But I think this will be a good starting point for achieving your final behavior.

    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top