The National Pokédex in Diamond, Pearl and Platinum unlocks when you have captured every Pokémon in the regional Sinnoh Dex.
You need to have caught them, not merely seen them — the requirement is ownership of each entry, so trades are usually necessary for the version-exclusive species and the evolutions that only appear in other games. Hatching eggs counts, so breeding is a legitimate route for anything you cannot find in the wild.
Once unlocked, the National Dex lets you register and track Pokémon from earlier generations, and it opens up post-game content that depends on having the full expanded index. Many players find the last few entries the hardest, since they hinge on events or trades rather than exploration.