[Port of a servicing fix for .NET 4.7-4.8]
Problem description:
Run app with custom GridView components, enable grouping.
Re-connect to the RDP session (or change the windows theme).
Actual behavior:
System.Windows.Automation.ElementNotAvailableException: Element does not exist or it is virtualized; use VirtualizedItem Pattern if it is supported.
at System.Windows.Automation.Peers.ItemAutomationPeer.ThrowElementNotAvailableException()
at System.Windows.Automation.Peers.ItemAutomationPeer.GetItemStatusCore()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdatePeer(Object arg)
Expected behavior:
Minimal repro: