Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
UltraMonthViewSingle appointments overlaps after increasing it's height
posted

Hi All,

I am using Infragistics V10.3. In my application i am using scheduling controls for calendar view same as MS Outlook 2007. On form, there are three control one for day view (UltraDayView), one for week view(UltraDayView with selected date range to 6 to look like Outlook work week view) and one for month view(UltraMonthViewSingle). I am able to increase the height of appoointments in both UltraDayView(for dayview and work weekview obviously) using creation filter and the text on appointments is bold. It works fine. Also i am able to increase the height of appointments in UltraMonthViewSingle using Creation Filter but it overlaps each other. Because in my case, mostly a single day has a multiple appointments. A text appointments on UltraMonthViewSingle is non-bold by default. An overlapping of appointment you can see in the attached image.

Scheduling Control

The code for UltraDayView's Creation Filter is as under.

Public Class DayViewAppointmentCreationFilter
    Implements IUIElementCreationFilter
    Public Sub AfterCreateChildElements(ByVal parent As UIElement) 
Implements IUIElementCreationFilter.AfterCreateChildElements
    
If TypeOf parent Is 
Infragistics.Win.UltraWinSchedule.DayView.AppointmentUIElement Then
            Dim appointment As Infragistics.Win.UltraWinSchedule.Appointment = 
 TryCast(parent.GetContext(GetType(Infragistics.Win.UltraWinSchedule.Appointment)), 
 Infragistics.Win.UltraWinSchedule.Appointment)
            
parent.Rect = New Rectangle(parent.Rect.X, parent.Rect.Y, parent.Rect.Width, 35)
        ElseIf TypeOf parent Is EditorWithTextDisplayTextUIElement Then
            Dim editor As EditorWithTextDisplayTextUIElement = 
DirectCast(parent, EditorWithTextDisplayTextUIElement)
            
editor.WrapText = True
            editor.MultiLine = True
            editor.Rect = New Rectangle(editor.Rect.X, editor.Rect.Y, editor.Rect.Width, 35)
        End If
    End Sub
    Public Function BeforeCreateChildElements(ByVal parent As UIElement) As Boolean 
Implements IUIElementCreationFilter.BeforeCreateChildElements
        Return False
    End Function
End Class


The code for UltraMonthViewSingle's Creation Filter is as under.

Public Class MonthViewSingleAppointmentCreationFilter
            Implements IUIElementCreationFilter
    Public Sub AfterCreateChildElements(ByVal parent As UIElement) 
        Implements IUIElementCreationFilter.AfterCreateChildElements
        
If TypeOf parent Is EditorWithTextDisplayTextUIElement Then
Dim editor As EditorWithTextDisplayTextUIElement = 
DirectCast(parent, EditorWithTextDisplayTextUIElement)
editor.WrapText = True
editor.MultiLine = True
editor.TrackCharactersRendered = True
editor.Rect = 
New Rectangle(editor.Rect.X, editor.Rect.Y, editor.Rect.Width, 35)
ElseIf TypeOf parent Is SingleDayAppointmentUIElement Then
Dim SingleDayAppointment As SingleDayAppointmentUIElement = 
DirectCast(parent, SingleDayAppointmentUIElement)
If SingleDayAppointment IsNot Nothing Then
SingleDayAppointment.Rect = 
New Rectangle(SingleDayAppointment.Rect.X, 
SingleDayAppointment.Rect.Y, 
SingleDayAppointment.Rect.Width, 35)
If SingleDayAppointment.ChildElements.Count > 0 Then
If SingleDayAppointment.ChildElements(0) IsNot Nothing 
AndAlso SingleDayAppointment.ChildElements.Count > 0 
AndAlso SingleDayAppointment.ChildElements(0).ChildElements.Count > 0 Then
If SingleDayAppointment.ChildElements(0).ChildElements(0) IsNot Nothing 
AndAlso TypeOf SingleDayAppointment.ChildElements(0).ChildElements(0) Is 
EditorWithTextDisplayTextUIElement Then
Dim editor As EditorWithTextDisplayTextUIElement = 
DirectCast(SingleDayAppointment.ChildElements(0).ChildElements(0), 
EditorWithTextDisplayTextUIElement)
editor.WrapText = True
editor.MultiLine = True
editor.Rect = 
New Rectangle(editor.Rect.X, editor.Rect.Y, editor.Rect.Width, 35)
End If
End If
End If
End If
End If
    End Sub
    
    Public Function BeforeCreateChildElements(ByVal parent As UIElement) 
          As Boolean Implements IUIElementCreationFilter.BeforeCreateChildElements
                  Return False
    End Function
End Class


I have a two questions and its too much critical for me since i did too much google and searched in Infragistics's forums also but didn't find any specific thread. And finally decided to ask you.

1.  I want to have non-bold text on every appointment in UltraDayView for both Day view and Work Week View. Is it possible?

2. An appointments on UltraMonthViewSingle overlaps each other since i have increased the height. Can you modify this creation filter in order to remove unnecessary overlapping of appointment or Can you write another one which can work for me?

Can you give me a sample in V10.3 and Visual Studio 2008 please or do any other help.

Thanks you so much.

Parents Reply Children