Hello,
On a usercontrol, I have a xamdatagrid.
the DataSource of this dataGrid refers to a property of the userControl dataContext.
In this datagrid, I have a column (define by TextField) where the label depends on a property of the userControl dataContext.
I have tryed many solutions but no one do the tricks. I show you some of my trys.
<igDp:TextField
Name="MySpecificColumn"
Label="{Binding DataContext.SpecificColumnHeaderDisplay , ElementName=UserControl}" //x:name="UserControl" define on the UserControl
Label="{Binding DataContext.SpecificColumnHeaderDisplay, RelativeSource = {RelativeSource FindAncestor, AncestorType={x:Type v:MyView}} // xmlns:v= namespace of my userControl
/>
Thanks you in advance for your helps
<igWPF:TextField Name="Name" > <igWPF:TextField.Settings> <igWPF:FieldSettings> <igWPF:FieldSettings.LabelPresenterStyle> <Style TargetType="{x:Type igWPF:LabelPresenter}"> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> <TextBlock Text="{Binding DataContext.SomeText, ElementName=uc}"/> </DataTemplate> </Setter.Value> </Setter> </Style> </igWPF:FieldSettings.LabelPresenterStyle> </igWPF:FieldSettings> </igWPF:TextField.Settings> </igWPF:TextField>