Multiselection with Control

Apr 28, 2010 at 2:30 PM

Hi

 

We have a modified Tree (WPF) on this tree multi selection of equal elements is possible (modified WPF Tree)

now I try to multiselect more elements which are not directly neighbours

 

for example

 

Tree

|_ element1<-- should be selected

|_ element2

|_ element3<-- should be selected

 

I create a List with all tree items which should be selected

 

and then:

 

Keyboard.Instance.HoldKey( KeyboardInput.SpecialKeys.CONTROL );
      
foreach( TreeNode node in selectedNodes )
{
AutomationElementHelper.ScrollAutomationElement( node.AutomationElement );
node.Select();
}
Keyboard.Instance.LeaveKey(KeyboardInput.SpecialKeys.CONTROL);

 

but not all items are selected :(

 

any ideas

 

with shift over group of elements it works

 

 

 

May 13, 2010 at 1:33 PM
Edited May 13, 2010 at 1:34 PM
public void Select(); - Deselects any selected items and then selects the current element. I would guess that's part of your issue. You may want to try ...... public void AddToSelection();
May 17, 2010 at 7:55 AM
Edited May 17, 2010 at 7:55 AM

Hi

 

thanks for answer

I'm not sure that tree elements have  AddToSelection().  I will have a look after vacation.

I have tried also with Click().

 

Throndorin

 

 

I will have a look after vacation
Coordinator
May 18, 2010 at 5:24 AM

can you also try with 0.20 of white as there were some issues with scan code causing the special keys to not working right in earlier versions of white.