Rightclick on RadWindow?

2 posts, 1 answers
  1. Michael Chong
    Michael Chong avatar
    18 posts
    Member since:
    Jul 2009

    Posted 07 Oct 2009 Link to this post

    I'm currently using RadControls_for_Silverlight_2009_2_0812_DEV. I set a content with RadContextMenu to a RadWindow. When I open multiple window and try to right click get the contextmenu from an unactive window, the contextmenu will popup but the window will not become active. Any solution that I can make the window become active when rightclick it? I have tried a solution by setting the RadWindow.BringToFront() on the RadContextMenu.Opened event but the window becomes active only after the contextmenu popup so the contextmenu is shown behind the window. Anyone has a better idea?

    By the way, I would like to know whether there is a latest build or release on RadControls for Silverlight 3.

    Thanks for any help and information.
  2. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 08 Oct 2009 Link to this post

    Hello Michael,

    I could suggest you is to use Mouse.AddMouseDownHandler method to add MouseDown handler to the RadWindow and to bring it to the front when this event is fired. I suggest you to inherit the RadWindow control and do this in its constructor. Here is an example:
    public class RadWindowWithContextMenu : RadWindow 
        public RadWindowWithContextMenu() 
        { 
            InitializeComponent(); 
            Mouse.AddMouseDownHandler(thisnew EventHandler<Telerik.Windows.Input.MouseButtonEventArgs>(OnMouseButtonDown)); 
        } 
     
        private void OnMouseButtonDown(object sender, Telerik.Windows.Input.MouseButtonEventArgs e) 
        { 
            this.BringToFront(); 
        } 

    Hope this helps.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
Back to Top