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

Silverlight 4, MVVM binding: Add Empty line in RadComboBox

1 Answer 127 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
qwer
Top achievements
Rank 1
qwer asked on 13 Dec 2010, 01:01 AM
Hi There,
     I'm using Silver4 with MVVM, no codebehine and directly binding by ViewModel.
How can I add Empty (blank) line in my radcombobox. So user can select that empty value while they don't have that particular information.
I bind like following.

 
  <telerik:RadComboBox Grid.Column="1"  Grid.Row="3"
 
                             HorizontalAlignment="Left"
                             VerticalAlignment="Top"
                             ItemsSource="{Binding Path=NameSuffixs, Mode=OneWay, NotifyOnValidationError=True,ValidatesOnExceptions=True, ValidatesOnDataErrors=True}"
                             SelectedValue="{Binding Path=Member.NameSuffixId, Mode=TwoWay}"
                             DisplayMemberPath="Description"
                             SelectedValuePath="SuffixId"
/>


I want to add blank(empty) value line in that binding.
Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Valeri Hristov
Telerik team
answered on 13 Dec 2010, 02:37 PM
Hello qwer,

RadComboBox always displays only the items in its ItemsSource, it cannot add items automatically. You should either add the "empty" item in your ViewModel, or enable the Clear button in RadComboBox:
http://www.telerik.com/help/silverlight/radcombobox-features-clearselectionbutton.html

Best wishes,
Valeri Hristov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
ComboBox
Asked by
qwer
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or