It is possible, I would check the devlepors reference guide but why bother when Infopath already has controls for doing such a task.
Typically in Infopath the user would just build the repeating list with the built in controls.
Put drop downs in the three field in a repeating table.
They set the first row, then insert a new row and pick the next combination, etc.
That way no c# or anything to mess with or debug.