This question made me realise that, really, we don't see many space walks in Star Trek. It got me to thinking about space walks generally in science-fiction and how they've been portrayed (like those in Lost in Space or Thunderbirds). My question is: what is the first instance in science fiction of a space walk being portrayed in film or television?
A Trip to the Moon (1902)
Although not featuring a typical space walk, I asked in chat and you said for your purposes it would count.
When escaping from the Selenites the crew of astronomers must escape from the moon and get back into space. Here is a quote from a Trip to the Moon Wikipedia describing the event.
The astronomers run back to their capsule while continuing to hit the pursuing Selenites, and five get inside. The sixth astronomer, Barbenfouillis himself, uses a rope to tip the capsule over a ledge on the Moon and into space. A Selenite tries to seize the capsule at the last minute. Astronomer, capsule, and Selenite fall through space and land in an ocean on Earth, where they are rescued by a ship and towed ashore.
I looked at all listed Sci-Fi films up until 1930. Films that took place in space or had a space element to them only took place on different planetary bodies, that is to say that when the characters were outside of the spacecraft they would be on a planet. Apart from the film cited above.
Destination Moon (1950)
As far as I know, the 1950 film Destination Moon has the first space walk scene.
With Destination Moon, George Pal produced the first major US science fiction film to deal with the dangers inherent in human space travel and the possible difficulties of America's first lunar mission landing on and safely returning from our only satellite....
On their way to Moon, they are forced to go outside Luna in zero gravity, wearing magnetic boots to stay on the hull, in order to free a frozen piloting radar antenna greased-up by the inexperienced Sweeney hours before the launch.
During their walk on the hull, one astronaut gets detached and another uses an oxygen tank as a "jetpack" to retrieve him before he drifts too far away. (Thanks to @Hypnosifl for reminding me of that particular part of the scene.)