Shed Media has agreed to buy Wall to Wall in a deal worth £20 million upfront and another £5 million depending on performance.

Wall to Wall co-founder and chief executive Alex Graham will become a Shed executive director and get £5.7 million of shares.

The Who Do You Think You Are?'s distribution firm, Wall to Wall International, will be integrated into Shed-owned Outright Distribution.

Shed chief executive Eileen Gallagher, confirming recent reports, commented: "Wall to Wall has some of the most successful television brands around and Alex Graham, who joins the Shed board with immediate effect, will make a great contribution to growing the group."

Graham added: "What I like about Shed is that it understands that commercial success is built on long-running programme brands and I'm looking forward to playing my part in creating the next generation of hit Shed shows."