KNAVE IN GRAIN. A knave of the first rate: a phrase
borrowed from the dyehouse, where certain colours are said to
be in grain, to denote their superiority, as being dyed with
cochineal, called grain. Knave in grain is likewise a pun
applied to a cornfactor or miller.

-- from the 1811 Dictionary of the Vulgar Tongue, by Captain Grose et al.