binding fail in ControlTemplate

2 posts, 0 answers
  1. Carles
    Carles avatar
    2 posts
    Member since:
    Apr 2011

    Posted 23 May 2011 Link to this post


    I have a ControlTemplate where I want to bind the datacontent.

    <Button Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75">
                    <telerik:RadComboBox ItemsSource="{Binding ListCombo, Mode=OneWay}"  
                        Text="{Binding Filter.SelectedText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEditable="True"  
                        IsSynchronizedWithCurrentItem="True" IsFilteringEnabled="True"  Margin="0,0,0,81" />

    Now it doesn't work properly but if I use only the control like below it work properly:

    <telerik:RadComboBox ItemsSource="{Binding ListCombo, Mode=OneWay}"  
          Text="{Binding Filter.SelectedText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEditable="True"  
           IsSynchronizedWithCurrentItem="True" IsFilteringEnabled="True" Margin="0,0,0,81" />


    What can I do to use it into a controltemplate?

    Thanks in advance,

  2. Pana
    Pana avatar
    748 posts

    Posted 27 May 2011 Link to this post

    Hello Carles,

    I do not understand what is the problem. I have created a small example that has two RadComboBoxes. One inside a Button's ControlTemplate and one directly onto the user control. The DataContext is of the UserControl is set to a proper ViewMode and both combos are bound to the same data. It works fine here. Could you check the attached project and see if it works for you and if not give us more exact details?

    Best wishes,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top