If the option is grayed out, it’s likely because you’re not running Computer Management as an administrator, or that the volume is formatted with a file system that cannot be extended. It is also possible that there’s unallocated space right after the select volume (check that lower-right box for the word “Unallocated”). If there is another volume between the selected partition and the unallocated area, you can delete that volume from the middle to allocate that space to the D drive. But if you do this, you’ll lose any data on that middle volume.