New to Telerik UI for WPFStart a free 30-day trial

UI Automation Issue with RadGridView on .NET 8

Updated on Sep 15, 2025

Environment

ProductVersion
UI for WPF2023.3.1114

Description

Automation peers cannot be accessed by UI Automation tests in a WPF project targeting .NET 8.

Solution

This is a bug in .NET 8 which is described in the following two Microsoft items:

To work it around, set the static _ItemsControlDoesNotSupportAutomation internal field of the System.Windows.AccessibilitySwitches class.

C#
	public partial class App : Application
	{
		public App()
		{
			var accessibilitySwitches = Type.GetType("System.Windows.AccessibilitySwitches, WindowsBase, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
			var field = accessibilitySwitches.GetField("_ItemsControlDoesNotSupportAutomation", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static | BindingFlags.DeclaredOnly);
			field.SetValue(null, 1);
		}
	}
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support