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
25
Visibility check of UltraTree vertical scrollbar
posted

Hi,

Is it possible to know whether the veritical scrollbar of UltraTree is visible or not? The "Scrollable" property of ultraTree is "ShowIfNeed".

Here is a little background info:

In my App, if I delete a lot of nodes(which make vertical scrollbar invisible) then select the parentNode of the deleted nodes through "Selected" property, the nodes above the parentNode are hidden and there is no scrollbar. So in this case I need to set "TopNode" property to root node so that all nodes are visible. 

Thanks.

Parents
  • 69832
    Verified Answer
    Offline posted

    There should never be nodes that are inaccessible, so if I understood this correctly, this sounds like a bug, although I was not able to reproduce that behavior. If you can get the control into a state where there is no scrollbar but there are nodes that cannot be accessed, you should report it as a bug.

    To answer your question, you can determine whether there is a vertical scrollbar currently being displayed in the following manner:

    private bool? HasVerticalScrollBar( UltraTree treeControl )
    {
        UIElement controlElement = treeControl != null ? treeControl.UIElement : null;
        if ( controlElement != null )
        {
            foreach( UIElement element in controlElement.ChildElements )
            {
                Infragistics.Win.UltraWinScrollBar.ScrollBarUIElement scrollBarElement =
                    element as Infragistics.Win.UltraWinScrollBar.ScrollBarUIElement;

                if ( scrollBarElement != null && scrollBarElement.Orientation == Orientation.Vertical )
                    return true;
            }

            return false;
        }

        return null;
    }

  • 230
    posted in reply to Brian Fallon

     Hi,

    I'm also having the same problem. My wintree will look like this.

     There are 2 more nodes before xls node. I have set the Scrollable property to 'ShowIfNeeded'.

    If i delete the node after xls, the scrollbar is not visible.

    If i change the Scrollable property to 'Show', after deleting the nodes, i move the mouse scrollbutton, then the scroll bar gets disabled. We are not able to view few of the top nodes(nodes before xls) .

    Is there any way to show scrollbar?

     

     

Reply Children
No Data