The XAML
OR
In case you want to override the OnCreateAutomationPeer of your dataGrid, you have to subclass the dataGrid -
And in constructor of your UserControl -
<UserControl>
<Grid>
<toolkit:DataGrid ItemsSource="{Binding Source={StaticResource DocumentsVS}}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False"
FontSize="16" Name="_dgDocuments" Style="{StaticResource EklektosDataGridStyle}" . . . >
</UserControl>
<Grid>
<toolkit:DataGrid ItemsSource="{Binding Source={StaticResource DocumentsVS}}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False"
FontSize="16" Name="_dgDocuments" Style="{StaticResource EklektosDataGridStyle}" . . . >
</UserControl>
OR
<local:MyDataGrid x:Name="dataGrid"/>
In case you want to override the OnCreateAutomationPeer of your dataGrid, you have to subclass the dataGrid -
public class MyDataGrid : DataGrid
{
protected override AutomationPeer OnCreateAutomationPeer()
{
return null;
}
}
And in constructor of your UserControl -
public CDocumentChecklistView()
{
InitializeComponent();
AutomationPeer a = UIElementAutomationPeer.CreatePeerForElement(dataGrid);
}
No comments:
Post a Comment