I have an UltraGrid bound to an UltraDataSource. One of the fields (DateOfBirth) is a date field. When the user clicks the "down" arrow to the right of the date (to pop up the calendar), it always defaults to 1/1/2001 (rather than the date in the cell) and then changes the date in the cell to 1/1/2001 once it has "popped up".
How do I get the UltraGrid to show the correct date (on the pop-up calendar) based on what is in the cell? For example, if the date in the cell is "5/1/1952", that's the date I want to show up when the user pops up the calendar -- not 1/1/2001.
Bfore-and-after screens shots are included.
If simply clicking the dropdown arrow is changing the date in the cell, then something is wrong. This is obviously not the intended behavior. I've never heard of that happening before. My best guess is that the field is not actually using the DateTime data type. Or perhaps something in your code is changing the value inadvertently.
If that does not help, then I'm not sure what else it could be. Can you post a small sample project demonstrating the issue? If so, I'd be happy to take a look.
Hey all,
Im using an UltraWinGrid with a DateColumn , when clicking the arrow the same type of calendar as yours is displayed.
I'd like to remove Saturdays and Sunday on this calendar but I don't have a direct access to a calendar object .
How can I customize this calendar ?
Thank you
Vianney
Hi,
If you have an older version of the grid, the property used to be called EditorControl. It was changed to EditorComponent a few years ago.
That's why i attended to do but UltraWinGrid.UltraGridColumn doest not contan a definition for EditorComponent
Hi Vianney,
I would use the grid's InitializeLayout event and do something like this:
e.Layout.Bands[0].Columns["My Column"].EditorComponent = this.ultraCalendarCombo1;
Hi Mike,
Thank you for your answer , i've found the UltraCalendarCombo & UltraCalendarInfo in my form and it's exactly what i was searching for.
But how do i set the grid colum's editor component to the UltraCalendarCombo ?
By default, DateTime columns in the grid use the DateTimeEditor, which uses as it's dropdown, the inbox MonthCalendar control. This control does not have the ability to disable or remove days of the week, as far as I can see.
So what you could do is use the UltraCalendarCombo control. Place one on a form, along with an UltraCalendarInfo component. Set the UltraCalendarComb's CalendarInfo to the UltraCalendarInfo component.
Then you can use the CalendarInfo's DaysOfWeek collection to hide any days you want.
Set the grid column's EditorComponent property to the UltraCalendarCombo control and it will replace the default dropdown.