Hello,
I have a DataGrid control, the ActualWidth of which I would like to bind to the one DataGridTemplateColumn's Width property like so.
<DataGrid.Columns><DataGridTemplateColumn Header="File Name" IsReadOnly="True" Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type DataGrid}}, Path=ActualWidth}"><DataGridTemplateColumn.CellTemplate><DataTemplate><WrapPanel><Image Source="{Binding FileName, Converter={StaticResource localImageSourceConverter}}" Margin="0,0,5,0" HorizontalAlignment="Left" Stretch="None"></Image><TextBlock Text="{Binding FileName}" HorizontalAlignment="Stretch" Margin="0,0,5,0"></TextBlock></WrapPanel></DataTemplate></DataGridTemplateColumn.CellTemplate></DataGridTemplateColumn></DataGrid.Columns>
However, the RelativeSource binding markup extension has no effect. Is this even possible?
Thank you,
Dan