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
230
Removale of Newline characters in Appointment Subject in TimelineView
posted

I have a calendar-centric application that uses the UltraCalendarInfo component in conjunction with UltraDayView, UltraWeekView, UltraMonthViewSingle and UltraTimelineView controls.  Users have the ability to customize the labels of Calendar Appointments as displayed within the Subject property by specifying which properties of my underlying domain object that they wish to display (e.g. Appointment No., Site Name, Job Priority, etc), and can include Newline characters between these domain object properties should they so desire.  The effect of this is that the Subject text can thus be displayed over multiple lines.

The problem I am having is that displaying the subject over multiple lines is fine which working in the UltraDayView control, but in the UltraTimelineView only the first line is actually visible.  Now obviously I don't what to remove the newline characters for the Appointment.Subject property as that will effect all calendar views but I am cannot find a way to omit them for the UltraTimelineView only.  I have looked at great detail on how this could be done using either or a DrawFilter or a CreationFilter without any success.

In the case of the DrawFilter I thought that perhaps handling the BeforeDrawChildElements DrawPhase of the Appointment would be the best way to go, but it (shown below) did not work.  Can anybody provide me with some clues as to the best way to attempt this?  Thanks.

Private Function HandleDrawPhaseBeforeDrawChildElements(ByRef drawParams As Infragistics.Win.UIElementDrawParams) As Boolean
  Dim result As Boolean = False
  Try
    If Not drawParams.DrawPhase = DrawPhase.BeforeDrawChildElements Then Exit Function
    If TypeOf drawParams.Element Is TimelineView.AppointmentUIElement Then
      Dim textElement As UIElement = drawParams.Element.GetDescendant(GetType(EditorWithTextDisplayTextUIElement))
      If textElement IsNot Nothing Then
        Dim textUIElement As EditorWithTextDisplayTextUIElement = CType(textElement, EditorWithTextDisplayTextUIElement)
        If textUIElement.Text.Contains(Environment.NewLine) Then
          textUIElement.Text = textUIElement.Text.Replace(Environment.NewLine, " ")
        End If
      End If
    End If
  Catch ex As Exception
    ' Do something?
  End Try
  Return result
End Function

Parents
No Data
Reply Children