I have attached Form1.cs to this post. This Csharp code represents a stripped down version of a problem I'm having with UltraDayView.
When I add an UltraDayView to a resizable Windows form, and set its fill mode to Dock, then I resize the Windows form, the UltraDayView resizes along with the Windows form.
Problem is, that when I resize the UltraDayView, the DayOfWeekHeader at the top randomly changes height. This is the part that contains the display of the currently selected date.
What's the big deal, you might ask? Well I'm trying to stick a Toolbar into this header area. When the header randomly changes height to a height that is too short, my toolbar dangles off of it, overlapping the Owner's names.
I am comfortable with using a CreationFilter or a DrawFilter to combat this default behavior, but I just don't know how I can cause the DayOfWeekHeader to always have the same fixed Height (prefer 42 pixels).
To repro the issue, please create a new Windows Forms project, and remove the program.cs and Form1.cs that Visual Studio puts in by default. Then, add my attached Form1.cs to the project.
You will need to add references to:
Infragistics2.Shared.v7.1
Infragistics2.Win.Misc.v7.1
Infragistics2.Win.UltraWinEditors.v7.1
Infragistics2.Win.UltraWinSchedule.v7.1
Infragistics2.Win.v7.1
You should be able to run the project with only my attached Form1.cs in the solution. Then, when it is running, just resize the window to see how the DayOfWeekHeader randomly changes Height.
I have also tried this with Infragistics version 7.3 but am having the same bad luck with it. Your help is greatly appreciated.
I need to preface this response with a disclaimer; I don't necessarily recommend doing what you describe here, but if you implement the IUIElementCreationFilter interface, and handle the AfterCreateChildElements method for the Infragistics.Win.UltraWinSchedule.DayView.AllDayEventAreaUIElement element, you will (a) hit that code whenever the height changes (hence your notification) and (b) have access to the height via the element's Rect.Width property.
I had an idea of how to work around this behavior. Can you please tell me if there is a value I can read from the DayView, to tell me the current height of the DayHeader area? I just need to know Where to read it from (what member), and When to read it (what event). If I can read the value of the height of the DayHeader area, I believe that I can place the DayView into a Panel and slide the DayView up and down when the height changes, so that the panel behind it shows through sometimes at the top to make the appearance of having a consistent height during resizing.
Brian, thank you for your reply.
The DayHeader seems to be maintaining some variable that contains the minimum and maximum heights that it can draw itself. Is there a way to tell it to use a certain other number (42) as that minimum?
What about deriving from DayView and handling PositionChildElements() or some other such event? Is that a valid approach?
What about setting AllowAllDayEvents to true, but making that area invisible in some other way? Would that be an approach to consider?
Sorry, I am just trying to think of any other way to solve this, besides waiting for a feature request to be fulfilled.
The reason for this is that the control negotiates the size of the all day event area to expand or contract so that an integral number of TimeSlots can be displayed, to emulate the behavior seen in MS Outlook. You have AllowAllDayEvents set to false here (presumably that was intentional), in which case the slack has to be picked up by the DayHeader instead.
Unfortunately there is no way to supress this behavior; if you like you can submit a feature request for the ability to allow a non-integral number of time slots to appear, i.e., switch off that resizing behavior and let the last time slot be partially clipped if necessary.