Hi,
How can I only show the day name in the dayview control and not the day number?
Thanks,
this.ultraDayView1.DayTextFormat = "dddd";
Hi, I have a problem with UltraDayView. The weekday displayed at the top center, is truncated only on Wednesday. The "y" is not displayed on the end, so it just says "Wednesda". I have looked on the forums and all through the documentation, and tried tweaking a bunch of properties on the UltraDayView control. But I still can't seem to track down where this is getting trunc'd. Can anybody help? In my code I am setting DayTextFormat to "dddd":
this.dayView.DayTextFormat = "dddd";
To clarify, that line was just a shortcut to reference the Infragistics.Win.UltraWinSchedule.DayView namespace. If you already had a using statement for that namespace, it would be unnecessary. It mainly comes in handy when you have other schedule controls on the same form, to prevent collisions since some of their UIElement names are the same.
Thank you, that was a good solution :)
I did change your code slightly, to remove "nsDayView." which wasn't needed.
Try this:
using nsDayView = Infragistics.Win.UltraWinSchedule.DayView;
this.ultraDayView1.CreationFilter = new DayOfWeekCreationFilter();
public class DayOfWeekCreationFilter : IUIElementCreationFilter{ void IUIElementCreationFilter.AfterCreateChildElements(UIElement parent) { nsDayView.DayHeaderUIElement headerElement = parent as nsDayView.DayHeaderUIElement; if ( headerElement != null ) { List<TextUIElement> textElements = new List<TextUIElement>(2); foreach( UIElement childElement in headerElement.ChildElements ) { if ( childElement is TextUIElement ) textElements.Add( childElement as TextUIElement ); }
if ( textElements.Count == 2 ) { headerElement.ChildElements.Remove( textElements[1] ); textElements.RemoveAt(1); }
if ( textElements.Count == 1 ) { TextUIElement textElement = textElements[0]; textElement.Rect = headerElement.RectInsideBorders; textElement.Text = headerElement.Date.ToString( "dddd" ); }
} }
bool IUIElementCreationFilter.BeforeCreateChildElements(UIElement parent) { return false; }}
The suggestion by Aaron Glover did not solve the issue (thanks anyway for trying). This is a problem regardless of the size the user chooses for the columns. I have tried setting both properties to 180 but this is still a bug:
this.dayView.MinimumColumnWidth = 180;
this.dayView.PreferredColumnWidth = 180;
In my company we are required to use Infragistics version 7.1 library, so upgrading is not a possibility.
Does anybody have any other creative suggestions for a way I could fix this with my own code?
This sounds like a bug that was fixed a while back. You should download the latest version and if the problem persists, report it as a bug.