As WarPig said, it is one of an infinite variety of dress bayonets worn as part of the walking out uniform by Germansoldiers. The gray color is due to oxidation of the base metal the item is made of, at one time it may have been nickel plated. It may or may not fit a rifle, it was not intended to be used on active service.
You should be proud to have it and treasure your Grandfather's stories about it, even if they were told with a wink.![]()