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
675
Navigation bar drop down lists
posted

When attempting to drop down a list of locations in the Navigation bar, it's sometimes tricky to find the drop down button. 

I'm interested in coding the Navigation bar to drop down the location list when the user clicks on the name of a location in the bar as well as the drop down button beside it.

The only possible solution I've come across would involve handling the mouse click event, translating the X and Y coordinates to try to determine which location as clicked and then force the list to drop down.

 Is there an easier way to do this?

 

 

Parents
No Data
Reply
  • 675
    posted

    I've managed code this and it was easier than I thought it would be. 

    private void ultraNavigationBar1_MouseClick(object sender, MouseEventArgs e)

    {

    System.Drawing.
    Point objPoint = new System.Drawing.Point(e.X, e.Y);

    // find out whether the user clicked an element of the control

    Infragistics.Win.UIElement objUIElement = this.ultraNavigationBar1.UIElement.ElementFromPoint(objPoint);if (objUIElement != null)

    {

    // See if we are over a location

    UltraNavigationBarLocation ClickedLoc = (UltraNavigationBarLocation)objUIElement.GetContext(typeof(UltraNavigationBarLocation));if (ClickedLoc != null)

    {

    if (ClickedLoc.HasLocations)

    {

    this.ultraNavigationBar1.ExpandedLocation = ClickedLoc;

    }

    }

    }

    }

Children
No Data