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

binding fail in ControlTemplate

1 Answer 62 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Carles
Top achievements
Rank 1
Carles asked on 23 May 2011, 02:59 PM
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,

1 Answer, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 27 May 2011, 06:32 AM
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
Tags
ComboBox
Asked by
Carles
Top achievements
Rank 1
Answers by
Pana
Telerik team
Share this question
or