Sampled-data control systems have steadily been gaining interest for their applications in Engineering and Automation. In the present paper we derive a Pontryagin maximum principle for general nonlinear optimal sampled-data control problems in the presence of running inequality state constraints. In particular we obtain a nonpositive averaged Hamiltonian gradient condition associated to an adjoint vector being a function of bounded variations. As a well-known challenge, theoretical and numerical difficulties may arise in optimal permanent control problems with state constraints due to the possible pathological behavior of the adjoint vector (jumps and singular part lying on parts of the trajectory in contact with the boundary of the restricted state space). However, in our case of sampled-data controls, we find that, under certain general hypotheses, the optimal trajectory only contacts the running inequality state constraints at most at the sampling times. In that context the adjoint vector only experiences jumps at most at the sampling times (and thus in a finite number and at precise instants) and its singular part vanishes. Hence, taking advantage of this bouncing trajectory phenomenon, we are able to implement a numerical indirect method which we use to solve three simple examples.