Hello
Thank you for your question and reaching out.
I can understand you are facing with extending C: partition.
Please note that you might see that there is unallocated space on the selected disk, but, this space is nonadjacent with the drive they wish to extend. This unallocated space should be right and behind the target drive, otherwise, the button will also be greyed out.
As per Microsoft guide :
If there's another volume in-between the unallocated space and the volume you want to extend, you can either delete the in-between volume and all files on it (make sure to back up or move any important files first!), use a non-Microsoft disk partitioning app that can move volumes without destroying data, or skip extending the volume and instead create a separate volume in the unallocated space.
https://learn.microsoft.com/en-us/windows-server/storage/disk-management/extend-a-basic-volume
--------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept as answer--