I figured out how to use data binding in the header of a DataGrid.
<DataGridTextColumn.Header>
<TextBlock Text="{Binding Path=DataContext.BaseCurrencyName,
RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}}"/>
</DataGridTextColumn.Header>
My WPF application uses a TabControl. If my initial tab is the tab where the referenced DataGrid appears then there is no problem. If another tab is the initial tab then the next message appears and the heading will be empty.
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGrid', AncestorLevel='1''. BindingExpression:Path=DataContext.BaseCurrencyName; DataItem=null; target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')
The message appears after leaving OnStartup in App.xaml.cs. At that point BaseCurrencyName already has value. And as I said, If my starting tab is the tab with the DataGrid then there is no problem.