double click on OpenFileDialog is raising ItemClick event on RadTreeview

2 posts, 0 answers
  1. Apar
    Apar avatar
    4 posts
    Member since:
    Jul 2015

    Posted 17 Jul 2015 Link to this post


    I have radtreeview control and when OpenFileDialog is shown on top of that control and an item is selected using double click, the OpenFileDialog gets closed which is the expected behavior as the file has been selected. But also the Itemclick event is fired on the treeviewitem which is exactly behind the point where the double click happened on the filedialog.


    Can you please let me know how to avoid the ItemClick event.


  2. Petar Mladenov
    Petar Mladenov avatar
    2882 posts

    Posted 21 Jul 2015 Link to this post

    Hello Apar,

    You have hit a know issue in the WPF framework - mouseup event fires on control behind OpenFileDialog when doubleclicking on a file.
    MSDN Forum - Stop Mouse Evtn from Firing..
    StackOverflow - Mouse left button up event and openfiledialog

    Generally, part of the issue at your side is that our ItemClick event is fired on Mouseup event of the RadTreeView, its not a typical click event to be raised after down + up on a single element. 

    There is know elegant solution for this, however, you can unsubscribe from ItemClick event before opening the OpenFileDialog and then subscribe after some interval (for example 500 milliseconds).
    You can find sample code below:
    DispatcherTimer timer;
    private void Button_Click(object sender, RoutedEventArgs e)
               OpenFileDialog dialog = new OpenFileDialog();
               this.tree.ItemClick -= this.tree_ItemClick;
               timer = new DispatcherTimer();
               timer.Interval = new TimeSpan(0, 0, 0, 0, 500);
               timer.Tick +=timer_Tick;
           void timer_Tick(object sender, EventArgs e)
               this.tree.ItemClick += this.tree_ItemClick;
               timer.Tick -= this.timer_Tick;
           private void tree_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)

    Petar Mladenov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top