Using M8 40mm instead of 5/16" x 1.5"

Additional question about screws - do they have to be half smooth/half threaded or do full thread screws work?

I have got full thread screws and they work.

Im using partially threated M8’s and they also work just fine

Thank you!