Add new ListItem feature in list box

2 posts, 0 answers
  1. Dharmavaram
    Dharmavaram avatar
    102 posts
    Member since:
    Jun 2013

    Posted 03 Jul 2017 Link to this post



    I want to have a deafult combobox at the end of listbox to add new listitem based on selection of item in combobox.

    It is similar to new row feature in radgridview.

    Is there any option like that or I can customize listbox template to have such feature?





  2. Dinko
    Dinko avatar
    914 posts

    Posted 06 Jul 2017 Link to this post

    Hello Dharmavaram,

    Thank you for contacting us.

    This functionality is not supported out of the box from the list box. An approach which you could try is to extract and edit the default template of the control. You can take a look at the Editing Control Templates help article in our documentation. In the extracted template you can modify the Grid in the ControlTemplate and add RadComboBox at the end. Then you can subscribe to the SelectionChanged event of the RadComboBox and depend on the selected item add new list box item.

    For your convenience, we have created sample project which demonstrates this approach.

    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top