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
490
How to get ScrollBarInfo of UltraTree?
posted

Hello,

Could you please tell how to get ScrollBarInfo object of an UltraTree? Is there any way to get ScrollBarInfo object if I iterate through UIElements of UltraTree till I get its ScrollBarUIElement? I get the ScrollBarUIElement by doing the following:

 foreach (Infragistics.Win.UIElement uiElement in ultraTree1.UIElement.ChildElements)
 {
                Infragistics.Win.UltraWinScrollBar.ScrollBarUIElement scrollBarUIElement = uiElement as Infragistics.Win.UltraWinScrollBar.ScrollBarUIElement;
                 
                Infragistics.Win.UltraWinTree.VerticalScrollbarUIElement verticalScrollbarUIElement = (VerticalScrollbarUIElement)scrollBarUIElement;

                if (scrollBarUIElement != null)
                {

                                //here i need a reference to ScrollBarInfo object (for tree's vertical scrollbar)                                                //what to do now?
                }

}

 

I also tried to do the following in order to get ScrollBarInfo of ultratree, but it doesnot return me correct values of ScrollBarInfo:

AppearancesCollection appearancesCollection = new AppearancesCollection(null);
appearancesCollection.Add(ultraTree1.ScrollBarLook.AppearanceVertical);                Infragistics.Win.UltraWinScrollBar.ScrollBarInfo sbInfo = new  Infragistics.Win.UltraWinScrollBar.ScrollBarInfo(ultraTree1, Orientation.Vertical,  appearancesCollection);

Thanks in advance.

-Nazish Kanwal

Parents
  • 69832
    Offline posted

    Yes, this recently came up with another product, so I added code to the GetContext method to recognize the ScrollBarInfo type. The fix was checked in on June 11 so I believe the latest service release contains this. You would then call the GetContext method off scrollBarElement, passing in typeof(ScrollBarInfo), and the returned object will be the ScrollBarInfo object the tree uses to manage its scrolling.

    Also note that the GetContext method was also revised recently to recognize typeof(System.Windows.Forms.Orientation), so you can now call GetDescendant off ultraTree1.UIElement, passing in typeof(ScrollBarUIElement) as the value of the 'type' parameter, and Orientation.Vertical as the value of the 'context' parameter, instead of iterating the ChildElements collection.

Reply Children
No Data