A device for treating a bone and a method of inserting such a device into a bone are disclosed. The device comprises segments forming a flexible body having first and second body ends and being configurable in a curved shape, at least one axial opening formed in the segments, flexible members disposed in at least one of the at least one axial opening, each member configured to move relative to at least one of the segments along an axial direction as the flexible body is being manipulated into the curved shape, and a mechanism disposed at one of the first and second body ends and being configurable to prohibit the flexible members from moving relative to one another to lock the flexible body into the curved shape.