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

    Hello

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

    <Button Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75">
        <Button.Template>
            <ControlTemplate>
                <StackPanel>
                    <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" />
                </StackPanel>
            </ControlTemplate>
        </Button.Template>
    </Button>








     
    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
    Admin
    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,
    Pana
    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
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top