New to Telerik UI for WPF? Start a free 30-day trial
Cannot Find Source for Data Binding with ElementName Reference
Updated on Sep 15, 2025
Environment
| Product Version | 2019.3.917 |
| Product | RadWizard for WPF |
Description
Cannot find the source of data binding with ElementName reference when the elements are in the RadWizardPage's Content.
The following code snippet shows the setup that reproduces the issue.
XAML
<telerik:WizardPage.Content>
<DataTemplate>
<StackPanel>
<Label Target="{Binding ElementName=txt_Code2}" Content="_code." />
<TextBox Name="txt_Code2" />
</StackPanel>
</DataTemplate>
</telerik:WizardPage.Content>
Solution
This behavior comes from an optimization in the RadWizard control. To resolve it, you can use ContentTemplate, instead of Content.
XAML
<telerik:WizardPage.ContentTemplate>
<DataTemplate>
<StackPanel>
<Label Target="{Binding ElementName=txt_Code2}" Content="_code." />
<TextBox Name="txt_Code2" />
</StackPanel>
</DataTemplate>
</telerik:WizardPage.ContentTemplate>
Or you can use the x:Reference keyword.
XAML
<telerik:WizardPage.Content>
<StackPanel>
<Label Target="{Binding Source={x:Reference txt_Code2}}" Content="_code." />
<TextBox Name="txt_Code2" />
</StackPanel>
</telerik:WizardPage.Content>