Is it possible to show the week numbers there in the UltraDateTimeEditor?
Handle the AfterDropDown event like so:
void ultraDateTimeEditor_AfterDropDown(object sender, EventArgs e){ UltraDateTimeEditor control = sender as UltraDateTimeEditor; MonthCalendar cal = DropDownManager.GetCurrentDropDownControl( control ) as MonthCalendar; cal.ShowWeekNumbers = true;}
I'm trying this code but it seems that when displaying week numbers, the month calendar does not resize correctly, the last day column is missing. Bug?
Hi there,
three years are gone...but its still the same bug?!
Something doing with this?
Hello Timur,
I suppose that your post is duplicate with a case CAS-121129-B7J1F3. When we display Week Numbers, we should increase the size of our parent container, because there are not enough space to display the dropdown part. For example you could try to code below:
private void ultraDateTimeEditor1_AfterDropDown(object sender, EventArgs e)
{
MonthCalendar cal = DropDownManager.GetCurrentDropDownControl(ultraDateTimeEditor1) as MonthCalendar;
cal.ShowWeekNumbers =true;
cal.Parent.Bounds =new Rectangle(cal.Parent.Bounds.X - 9, cal.Parent.Bounds.Y, 250, 170);
}
Let me know if you have any questions
Regards
Hi Georgi,
I tried out this like you mentioned, but Week #1 should be Dec 28th 2014 - Jan 3rd 2015, it looks like it's off by 1 - is there a way to change this offset so that it matches what the standard is?
Chris
Example of Incorrect Week #53.
I also had an issue with sometimes the edge of the column cuts off the control like below, do you know the best way to avoid this?
The control in the DropDown of the UltraDateTimePicker is the MonthCalendar control. It's part of the DotNet framework, so it's not an Infragistics control and we don't have any control over how it shows the week numbers.
I noticed, however, that the control displays the week numbers the way you want them in the newest version when Visual Styles are on. The screen shots you show here show the old look of the control. Microsoft updates this control with newer operating systems. So if you create a new project where Visual Styles are enabled, it shows "1" for the first week.
Depending on what OS you are using and what version of VS you have, you can turn on visual styles and that might help. Of course, this affects your entire application, not just this one control.
Application.EnableVisualStyles();
Another option would be to use the UltraCalendarCombo instead of UltraDateTimePicker. UltraCalendarCombo IS an Infragistics control. So you just set WeekNumbersVisible to true on the control and it displays the numbers the way you want.
Thanks for the response Mark, do you have a link to an example of using UltraCalendarCombo inline from a UltraGrid cell?