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
65
UltraTree arrow up and down action
posted

Hi,

Currently if the first item is selected and I press the arrow up key nothing happen.

The expected behaviour is: that selection jumps to the last item.

Currently if the last item is selected and I press the arrow down key nothing is happen.

The expected behaviour is: that selection jumps to the first item.

It is possible to change the arrow up and down behaviour to expected behaviour by a property?

If not how can I achieve this? Sample code is always welcome :)

Thanks.

Bye

Uwe

Parents
  • 22832
    Verified Answer
    Offline posted

    Uwe,

    This can be accomplished by adding a few TreeKeyActionMappings to the tree's KeyActionMappings:

    this.ultraTree1.KeyActionMappings.Add(
        new TreeKeyActionMapping(Keys.Up,
            UltraTreeAction.LastNode,
            UltraTreeState.InEdit | UltraTreeState.ActiveCell,
            UltraTreeState.FirstNodeActive,
            SpecialKeys.AltCtrl,
            0));
    
    
    this.ultraTree1.KeyActionMappings.Add(
        new TreeKeyActionMapping(Keys.Down,
            UltraTreeAction.FirstNode,
            UltraTreeState.InEdit | UltraTreeState.ActiveCell,
            UltraTreeState.LastNodeActive,
            SpecialKeys.AltCtrl,
            0));

    You may also want to review the UltraTreeState and UltraTreeAction Enumerations to see what else you can accomplish with KeyActionMappings.

    Let me know if you have any questions.

Reply Children
No Data