This is a migrated thread and some comments may be shown as answers.

I need to be able to deselect

2 Answers 179 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Kristjan Einarsson
Top achievements
Rank 1
Kristjan Einarsson asked on 09 Aug 2012, 01:45 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Vladi
Telerik team
answered on 10 Aug 2012, 07:24 AM
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.

0
Kristjan Einarsson
Top achievements
Rank 1
answered on 10 Aug 2012, 10:48 AM
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
Tags
ComboBox
Asked by
Kristjan Einarsson
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Kristjan Einarsson
Top achievements
Rank 1
Share this question
or