How to choose few component & create a group?

How to choose few component & create a group?

We want choose component and <Ctrl+G> for grouping & <Ctrl+Shift+G> for Ungrouping.

Is there any example to create group Without drag & drop from tool palette?

Thanks a lot.

Create Group is working using myDiagram.commandHandler.groupSelection();
But Ungroup is not working using myDiagram.commandHandler.ungroupSelection();

Does that command work for you in the Basic sample? If so, what is different between the group template and command handler in that sample and in your app?

Have you read CommandHandler | GoJS API and CommandHandler | GoJS API to see what you might have missed?