Tv adventurer Bear Grylls has signed a $1.6 million (£1 million) deal to write a series of books inspired by the wartime stories of his soldier grandfather.