Best way to insert custom item in the filtered list?

3 posts, 0 answers
  1. Alexandre
    Alexandre avatar
    7 posts
    Member since:
    Apr 2015

    Posted 22 Jul 2015 Link to this post

    Hi,

    I use the autocompletebox, which have a list of country as ItemsSource. From this autocompletebox, I would have the possibility to add a new country, which is not in the current list. To do that, I want to have a custom item in the filtered list, which do something special and is selectable as an other item of the list.

    I have the idea to add a special item in the ItemsSource and change the template of this special item with a TemplateSelector, but I would like to know if it exists a best way to do that?

    I have attached a picture to illustrate what I would like to do.

    Thanks for your help!

    Alex

  2. Nasko
    Admin
    Nasko avatar
    588 posts

    Posted 27 Jul 2015 Link to this post

    Hello Alexandre,

    It seems the approach you choose to use and came up with is a fine one. However, we also suggest you to check the following example from our online XAML SDK Repository which demonstrates how to add new items by using a Button:
    https://github.com/telerik/xaml-sdk/tree/master/AutoCompleteBox/AddNewItemsWithButton

    Hopes this helps.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Alexandre
    Alexandre avatar
    7 posts
    Member since:
    Apr 2015

    Posted 28 Jul 2015 in reply to Nasko Link to this post

    Hi!

    That's not exactly what I searched, but I've found a workaround to manage that and it works fine

    Thanks for your help!

    Regards!

    Alex

Back to Top