The sticker price is competitive but the cost per flight hour and the availability factor is pretty horrifying. Factoring in the cost of flying and the availability makes the Grippen about half the cost.
I wonder if the flight hour cost of F 35 includes the maintenance it's undergoing when it's not available.
The Gripen is a fantastic jet, but you're basically describing the difference between a fourth and fifth generation platform. When Saab and Embraer roll out their own fifth-generation jets, they will also have to contend with expensive RAM coating and complex internal hardpoints.
Putting aside the export market, it's a small miracle that the F-35 turned out as well as it did. Having a mostly-common fighter airframe shared between the Navy, Marines and Air Force was a pipe dream in the 90s. America is lucky the program didn't collapse entirely.
The Grippen is incredibly vulnerable to anti air missiles.
4th generation platforms like Grippen are not survivable in a modern air defense environment without complementary 5th generation platforms to establish air superiority. You can't avoid having a fleet of something like F-35 to gain control of the airspace.