Dynamic Enums or Custom Drop Downs for the Details Panels

Hm, how would this be doable?
I’m trying to have a byte which can be set to a number. Depending on this number I want to show a dropdown menu (dynamic enum??) with e.g. numbers from 1 to ‘byte-number’. This dropdown list would need to change dynamically when changing the byte.
This all shall take place in the details panel in the editor (PostEditChangeProperty()…).

I don’t have any ideas so far : s.