How to add Automation Id in each cell in DataGrid?

Posted by: gunjalgajjar on 27 November 2019, 5:44 am EST

    • Post Options:
    • Link

    Posted 27 November 2019, 5:44 am EST

    Hi,

    We are using WPF DataGrid Version 3. We need to add AutomationId in each datagrid cell. Below Code is used to add AutomationId in SetCellStyle at DataGridCellPresenter

     var random = string.Concat(cell.Row.Index, cell.Column.Index);
                cell.SetValue(UidProperty, "cell" + random.ToString())
    ```;
    
    But This AutomationId is not detected in Inspect.exe.
    DataGrid does not exposes TextBlock Automation properties .
    
    [b]How to Set AutomationId at cell level and get it detected using Automation tool.[/b]
  • Posted 28 November 2019, 5:56 am EST

    Hello,

    We have a product sample application ‘DataGrid_UIATest’ that shows how to perform Automation for C1DataGrid for WPF. You can find the application installed at C:\Users\GPCTAdmin\Documents\ComponentOne Samples\WPF\C1.WPF.Automation\CS

    If the application does not help, we request you to please share your application along with scripts related to C1DataGrid for WPF.

    Thanks,

    Ruchir

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels