Articles in this section
Category / Section

How to restrict the shortcut buttons in WinForms GridGroupingControl?

2 mins read

Restrict the shortcut key


In order to restrict the command of the shortcut buttons in grid, the ProcessCmdKey method of Form can be used. In the article below, the Ctrl+Shift+R key, which invokes the reset command, has been restricted in WinForms GridGroupingControl.

C# 

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
   //To restrict the Ctrl+Shift+R key.
   if(keyData==(Keys.Control | Keys.Shift | Keys.R))
   {
      return true;
   }
   return base.ProcessCmdKey(ref msg, keyData);
}

VB

Protected Overrides Function ProcessCmdKey(ByRef msg As Message, ByVal keyData As Keys) As Boolean
   'To restrict the Ctrl+Shift+R key.
   If keyData=(Keys.Control Or Keys.Shift Or Keys.R) Then
      Return True
   End If
   Return MyBase.ProcessCmdKey(msg, keyData)
End Function

Samples:

C#: Disable_ShortcutButtons_CS

VB: Disable_ShortcutButtons_VB

 

Conclusion


I hope you enjoyed learning about how to restrict the shortcut buttons in WinForms GridGroupingControl.


You can refer to our WinForms GridGroupingControl feature tour page to know about its other groundbreaking feature representations and WinForms GridGroupingControl documentation, and how to quickly get started for configuration specifications.


For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.


If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied