Hi
I'm looking to create a custom filter control to use on a popup container control. Essentially I want two calendars side by side where a user can select a start and end date, one from each calendar. I also want them to have the ability to select the start year without having to scroll through years of dates to find the date in a particular year. The standard windows forms date time picker has this functionality but I haven't found an infragistics calendar control with this functionality (so if you click on the month in the heading it drills to the months with the year on top then you can drill through the years) . I've tried the UltraMonthViewSingle control that comes close as it doesn't require drop down but cant see a way of displaying the year and drilling through them.
Any advice would be appreciated.
Cheers
Dave
Hello Dave,
I would like to suggest using UltraDateTimeEditor, which is based on MS MonthCalendar. However, there is only one calendar in the dropdown of the component, so you can use two of them, and bind the startDate and endDate and make sure the startDate is before the endDate.
The other option which I can offer is using ultraTextEditor and modifying the DropDownEditorButton to contain two calendars. You can use a panel to hold them so it will look like this:
this.tableLayoutPanel1.Controls.Add(this.monthCalendar1); this.tableLayoutPanel1.Controls.Add(this.monthCalendar2); DropDownEditorButton editorButton = new DropDownEditorButton(); editorButton.Control = this.tableLayoutPanel1; this.ultraTextEditor1.ButtonsRight.Add(editorButton);
In this case it would be best if you do not allow the user to be able to write in the editor and have him select dates from the calendars.
Please let me know if you need help implementing any of the ideas above, and I will be happy to assist you.
Sincerely,Tihomir TonevAssociate Software DeveloperInfragistics
Hi Tihomir
Thanks for the suggestions. However the solution I was looking for was to not have to use a dropdown to have to select a date but have a display like the MonthCalendar in standard windows controls but it looks like infragistics don't have this type of control.
The second approach, with two MonthCalendars on a DropDown seems like it would be very neat.
But there would be a lot of coding involved, I think.
You might want to put in some labels to make it clearer what the calendars are for. Also, there's the question of whether you want the user to be allowed to type into the combo. And if so, you would need some kind of parsing logic to turn the user-entered string into a range of dates. Presumably using some kind of custom format like using a dash to separate the dates. You would want to handle the dropping down of the button so you can synchronize the calendars with the current date range. And then there is error-handling for when the parsing fails. It would be interesting to make this work, though. :)