I am using jquery datepicker. Whatever position you have to set you can mention it in beforeShow function.
@Html.TextBoxFor(m => m.FromDate, new { style = "width: 200px;" })
@Html.TextBoxFor(m => m.ToDate, new { style = "width: 200px;" })
<script type="text/javascript">
$(document).ready(function () {
$("#ToDate").datepicker(
{
beforeShow: function (input, inst) {
inst.dpDiv.css({ marginTop: -input.offsetHeight + 'px', marginLeft:input.offsetWidth + 'px' });
},
changeYear: true,
yearRange: '-2:' + new Date().getFullYear(),
onClose: function (selectedDate) {
$("#FromDate").datepicker("option", "maxDate", selectedDate);
},
});
});
</script>