PassWordBox.Focus() does not scroll the passwordbox into view

Thread is closed for posting
2 posts, 0 answers
  1. Curtis
    Curtis avatar
    7 posts
    Member since:
    Jun 2011

    Posted 04 Dec 2014 Link to this post

    I have a stackpanel with 2 RadTextBox and 2 RadPasswordBox in vertical position.

    In the OnKeyDown event I "tab" to the next control in the stackpanel:

    private void OnKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
                if (e.Key != Key.Enter) return;
                var control = sender as Control;
                if (control != null) control.TabToNextControl((Panel)control.Parent, this);

    and the following code does the focusing of the next control:

    public static void TabToNextControl(this Control control, Panel parentContainer, Page parentPage)
                // First hide the virtual keyboard

                // Add 1 to calculate the next tab index
                int nextTabIndex = control.TabIndex + 1;

                // Check the controls in the parentcontainer for the next tab index and focus that control
                foreach (var c in parentContainer.ChildrenOfType<Control>())
                    if (c.TabIndex.Equals(nextTabIndex))

    When I tab from radtextbox to next radtextbox it works and the newly focused control scrolls into view with the keyboard open. When i tab from the normal textbox to textbox or passwordbox it works also. But when I focus the radpasswordbox it get the focus (colored rectangel around it) but it is not scrolled into view like the other control. 

    Could this be a little bug? Radtextbox is descendent of Textbox and Radpasswordbox is descendent of radcontrol. Could this cause it and how to solve it?

    Thanx in advance for the answer.
  2. Ivaylo Gergov
    Ivaylo Gergov avatar
    691 posts

    Posted 09 Dec 2014 Link to this post


    Please refer to the following forum thread :

    Ivaylo Gergov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top