Articles in this section
Category / Section

How to restrict the shortcut buttons in WinForms GridGroupingControl?

1 min read

Restrict the shortcut key

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

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’s feature tour page to know about its other groundbreaking feature representations. You can also explore our   WinForms GridGroupingControl documentation to understand how to present and manipulate data.

For current customers, you can check out our WinForms 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 WinForms GridGroupingControl and other WinForms components.

If you have any queries or require clarifications, please let us know in comments 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 sign in to leave a comment
Access denied
Access denied