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

Lost SelectionBoxTemplate if IsEditable =true

1 Answer 45 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
didier
Top achievements
Rank 1
didier asked on 05 Sep 2011, 05:28 PM
Hi,
I have a problem to use the SelectionBoxTemplate property if I use it with a business entity and iseditable property set to true & IsReadOnly set to true.
I have an entity x with a property DateEcheance of type date time.
A collection of this entity is bind to the itemSource of the radComboBox
<telerik:RadComboBox  Grid.Row="3" Grid.Column="1" ItemsSource="{Binding DateEcheanceList}"  
ItemTemplate
="{StaticResource comboBoxDateTemplate}" 
SelectionBoxTemplate
="{StaticResource dateEcheanceSelectedTemplate}"  
/>

my templates are set like this
<DataTemplate x:Key="comboBoxDateTemplate">             
<TextBlock  Text="{Binding Content.DateEcheance}"/>         
</DataTemplate>         
<DataTemplate x:Key="dateEcheanceSelectedTemplate">             
<TextBlock  Text="{Binding DateEcheance,StringFormat=\{0:d\}}"/>         
</DataTemplate>


if i set the isEditable property to false, when i select an element, the selected item is displayed correctly (display the date DateEcheance) but if i set the isEditable property to true, the selected item displayed is the id of the object x !

so , do you have a workaround for this (i just want to see the same style if i set IsReadonly to true or false)

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 06 Sep 2011, 11:40 AM
Hi Didier,

By design when IsEditable property is enabled, the templates are not applied, there is a textbox instead. Please try setting SelectedValuePath and TextSearch.TextPath properties of the ComboBox.

Hope this helps.

Kind regards,
Yana
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
ComboBox
Asked by
didier
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or