I want to set datacontext of a usercontrol inside a DataGridTemplateColumn, but it dosen't work,here's the code:
<DataGrid AutoGenerateColumns="False" ItemsSource="{Binding RequesterPeoples}">
<DataGrid.Columns>
<DataGridTemplateColumn Header="name" Width="200">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<MvvmCommonControl:CustomDataGridSelectorControl DataContext="{Binding DataContext.RequesterPeoplesDataContext,ElementName=MyWindow}">
<MvvmCommonControl:CustomDataGridSelectorControl.DataGridColumns>
<MvvmCommonControl:DataGridColumnCollection>
<DataGridTextColumn Header="FarsiNmae" Width="100" Binding="{Binding FarsiName, Mode=OneWay}"></DataGridTextColumn>
</MvvmCommonControl:DataGridColumnCollection>
</MvvmCommonControl:CustomDataGridSelectorControl.DataGridColumns>
</MvvmCommonControl:CustomDataGridSelectorControl>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>