This is a migrated thread and some comments may be shown as answers.

Unable to disable the radcommandbar mouse right click

1 Answer 122 Views
CommandBar
This is a migrated thread and some comments may be shown as answers.
Trisha
Top achievements
Rank 1
Trisha asked on 29 Oct 2018, 01:17 PM

Hello,

On Telerik control , when I click the and 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.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 Oct 2018, 03:01 PM
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.
Tags
CommandBar
Asked by
Trisha
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or