The Group by and the Ungroup items in the context menu should not appear if RadGrid grouping is not enabled. However if it is, and you want to remove them, you will need to add the preceding code on each separate page.
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items