In Windows Forms we are using Infragistics UltraWinTree control.
Goal : collapse all the tree items using UI Automation(UIAutomationClient.dll).
For more details about the UI Automation please refer: https://msdn.microsoft.com/en-us/library/ms747327(v=vs.110).aspx
Below is the code.
if (true == elementNode.TryGetCurrentPattern(InvokePattern.Pattern, out object patt))
{
invokePattern = patt as InvokePattern;
invokePattern.Invoke()
}
Issue : Last treeitem is not collapsing. When I see the element in the UI Spy, for the last treeitem "InvokePatternAvailable" property shows false. For last treeitem only Invoke Pattern is not available, for this reason above if condition will not satisfy.
My Question is: Is this correct way to collapse the Infragistics treeitem Or Is there any bug in Infragistics controls?
ExpandCollapsePatternAvailable==true
? – Dogged