Unable to disable the radcommandbar mouse right click

2 posts, 0 answers
  1. Trisha
    Trisha avatar
    1 posts
    Member since:
    Oct 2018

    Posted 29 Oct 2018 Link to this post

    Hello,

    On Telerik control winforms, when I click the radcommandbar and radmenu items using mouse right click, it calls the same function of the left click & I'm unable to disable it. Please let me know if there is any property to disable the right click.

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3281 posts

    Posted 29 Oct 2018 Link to this post

    Hello, Trisha, 

    If you have subscribed to the CommandBarButton.Click event it will be triggered no matter if you click the right or left mouse button. However, you can check in the MouseEventArgs whether left button is clicked and only then execute the action. Here is demonstrated a sample code snippet:

    private void commandBarButton1_Click(object sender, EventArgs e)
    {
        MouseEventArgs args = e as MouseEventArgs;
        if (args != null && args.Button == System.Windows.Forms.MouseButtons.Left)
        {
            //perform the desired action here  
            Console.WriteLine(DateTime.Now.ToLongTimeString());
        }
    }

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top