I use WebMonthCalendar as dropdown for WebDatePickerwhen I only want to change the year I have to select the day after selecting then year
is there a way around that?
Hello Christian,
If I understand you correctly you want to select year directly instead of selecting day and month first.
There is way to force the calendar to open its year view on first load instead of day calendar.
<script type="text/javascript" id="igClientScript"> var datePicker; function DatePicker_CalendarOpening(sender, eventArgs) { datePicker = sender; setTimeout("showMonths()", 10); } function showMonths() { datePicker.get_calendar().showList(1); } </script>
<script type="text/javascript" id="igClientScript">
var datePicker;
function DatePicker_CalendarOpening(sender, eventArgs) {
datePicker = sender;
setTimeout("showMonths()", 10);
}
function showMonths() {
datePicker.get_calendar().showList(1);
</script>
Let me know if this solution is acceptable in your scenario.
our user want to select in this order day - month - year in one go
or just select a year
Hello, I'm just wanting to check in if anything has changed with the WebMonthCalendar since this was originally posted/answered. I am currently trying to implement something similar. Thanks
This kind of functionality can be considered as feature request and if you like to see this functionality in future releases, feel free to submit feature request on the following link - http://devcenter.infragistics.com/Protected/RequestFeature.aspx
Thank you for using Infragistics components.
We will try to find a different kind of control
Inform me if you have additional questions.
If you want to select only year you should change the code for list showing (from my previous post) like that:
datePicker.get_calendar().showList(2); // show year calendar
And set the display mode for picker to show only the year:
DisplayModeFormat="yyyy"
The other requirement is not supported by default and you can try to implement it by changing the lists showed (day, month, and year) on calendar click event or on ”SelectionChanged” event.
Let me know if you have further questions.