Avoid issues while dynamically adding date pickers

Code to avoid issues while dynamically adding DateTimePicker on the
View.