Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
Retrieving virtualized items in xamDataGrid with Microsoft UIA...
posted

I'm working on a project to automate one of our WPF projects that utilizes the xamDataGrid control. I'm able to drill down to the "Records" datagrid inside of xamDataGrid but I am having some difficulty trying to load a virtualized record that appears inside of the grid.

I'm implementing the ItemContainerPattern and using the FindItemByProperty method with the Name/AutomationId of the element that I am searching for but when it is virtualized in the list it always returns null. If the item is not virtualized I am able to get an element back every time however.

I've temporarily switched the data grid to use RecordContainerGenerationMode="PreLoad" and everything works but this is not a change that I can make in our production code.

Digging around the various control patterns it sounds like this would normally be resolved by using ItemContainer to return the object and if that object is virtualized it is supposed to return a placeholder object. You can then use the VirtualizedItem pattern with the Realize method on the object to force it into the visual tree. Unfortunately it appears that the VirtualizedItem control pattern is not implemented for this control.

I've been trying to utilize a combination of the Scroll pattern and the ItemContainer pattern to first scroll the element into the visual tree but even after scrolling down to it's location I am unable to retrieve it via UIA.

Any recommendations?

Parents
  • 16495
    Offline posted

    Hello Matt,

     

    Thank you for your post.

     

    I have been looking into it, but it seems like I am missing something about your scenario, so if this is an issue for you, could you please send me, an isolated sample application, where this is reproduced, so I can investigate it further and support you.

     

    Looking forward to hearing from you.

Reply Children