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
100
Ultra tree column header click
posted

How do i captured event when user click on ultra tree column header.

thanks in advanced. any suggestion appreciated.

Parents
  • 69832
    Offline posted

    There is no event that specifically corresponds to the end user clicking on a column header, but there is an AfterSortChange event which fires after a column is sorted. If your objective is to receive a notification when a column is sorted, that is the event you should handle.

    You can also handle the MouseDown event and hit test for an element of type UltraTreeNodeColumnHeaderUIElement, as demonstrated by the following code sample:

    void ultraTree_MouseDown(object sender, MouseEventArgs e)
    {
        UltraTree tree = sender as UltraTree;
        UIElement controlElement = tree.UIElement;
        UIElement elementAtPoint = controlElement != null ? controlElement.ElementFromPoint( e.Location ) : null;
        UltraTreeNodeColumnHeaderUIElement headerElement = null;

        while ( elementAtPoint != null )
        {
            headerElement = elementAtPoint as UltraTreeNodeColumnHeaderUIElement;
            if ( headerElement != null )
                break;

            elementAtPoint = elementAtPoint.Parent;
        }

        if ( headerElement != null )
        {
            //  If you get in here, the mouse was pressed over a column header.
        }
    }

Reply Children