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
80
Capture mouse click on icon
posted

I have an UltraListView (View = List) with icons and check boxes enabled. How do I capture mouse clicks on the icon? 

Parents
No Data
Reply
  • 69832
    Offline posted

    void listView_MouseClick(object sender, MouseEventArgs e)
    {
        UltraListView listView = sender as UltraListView;
        UltraListViewUIElement controlElement = listView.UIElement;
        ImageUIElement imageElement = controlElement.ElementFromPoint( e.Location ) as ImageUIElement;

        if ( imageElement != null )
        {
            UltraListViewItem item = imageElement.GetContext( typeof(UltraListViewItem) ) as UltraListViewItem;

            if ( item != null )
                this.OnImageClick( item );
        }
    }

    private void OnImageClick( UltraListViewItem item )
    {
    }

Children