Lost SelectionBoxTemplate if IsEditable =true

2 posts, 0 answers
  1. didier
    didier avatar
    7 posts
    Member since:
    Nov 2010

    Posted 05 Sep 2011 Link to this post

    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}"  
    ="{StaticResource comboBoxDateTemplate}" 
    ="{StaticResource dateEcheanceSelectedTemplate}"  

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

    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)
  2. Yana
    Yana avatar
    5043 posts

    Posted 06 Sep 2011 Link to this post

    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,
    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 >>

Back to Top