I need to be able to deselect

3 posts, 1 answers
  1. Kristjan Einarsson
    Kristjan Einarsson avatar
    95 posts
    Member since:
    Jan 2010

    Posted 09 Aug 2012 Link to this post

    Hi,
    I have a combobox witch has one or more items declared like this ->
    <telerik:RadComboBox Grid.Column="1" Grid.Row="5" Margin="5" Height="25" Width="250" Name="cmbDynamicDim" HorizontalAlignment="Left" DisplayMemberPath="Name"
                                ItemsSource="{Binding DynamicDims}" SelectedItem="{Binding SelectedField,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" >

    But when I select an item there is no way of un-choosing the comboboxitem. Is there any property that creates an empty dummy row ? Or do I need to have an "empty" row in my collection  ?


    Thanks and best regards
    Kristján
  2. Answer
    Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 10 Aug 2012 Link to this post

    Hi Kristján,

    You can use the ClearSelectionButton property to achieve the wanted requirement in your project. The following code snippet shows how to declare the property in the ComboBox control:

    <telerik:RadComboBox ClearSelectionButtonContent="Clear Selected Item"
                          ClearSelectionButtonVisibility="Visible"/>

    Hope this helps.

    Greetings,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Kristjan Einarsson
    Kristjan Einarsson avatar
    95 posts
    Member since:
    Jan 2010

    Posted 10 Aug 2012 Link to this post

    Thanks This works fine :)
    But it would look better with the first row empty ie with index -1 or somthing.. just an idea.

    Thanks again
Back to Top