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.
The code for UltraDayView's Creation Filter is as under.
The code for UltraMonthViewSingle's Creation Filter is as under.
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.
Hi,
Please implement the code below to achieve the result from screenshot:
Code:
Public Class CreationUIElement
Implements IUIElementCreationFilter
Public Sub AfterCreateChildElements(parent As UIElement)
Dim El As Office2007MoreActivityIndicatorUIElement = TryCast(parent, Office2007MoreActivityIndicatorUIElement)
If El IsNot Nothing Then
Dim aa = El.GetAncestor(GetType(WeekUIElement)).GetDescendant(GetType(DayNumberUIElement), El.[Date])
El.Rect = New Rectangle(aa.Rect.X + aa.Rect.Width - El.Rect.Width, aa.Rect.Y + 2, El.Rect.Width, El.Rect.Height)
End If
End Sub
Public Function BeforeCreateChildElements(parent As UIElement) As Boolean
Return False
End Function
End Class
Let me know if you have any questions
Hi Georgi,
Georgi said:Maybe one possible solution could be if you change location of your MoreActivityIndicatioUIElement. I see that you have available space in the left and right side.
This solution i can't be implement as my control size changes runtime, hence the every single day resize and have to resize the width of appointment according to day in which it stays.
Georgi said:Another possible approach could be if you create additional MoreActivityIndicatioUIElement with parent DayNumberUIElement. By this way you MoreActivityIndicator will appear in the header of your Day Element
I agree with this approach and i tried to add a new MoreActivityIndicatorUIElement to the DayHeaderUIElement and also tried to add on DayUIElement but it doesn't seem to work/visible. The following code is to add activity indicator to DayNumberUIElement, the same tried with DayUIElement, but also doesn't seem to work. And finally i put the same code in AfterCreateChildElements and the result is attached image.
Public Sub AfterCreateChildElements(ByVal parent As UIElement) Implements IUIElementCreationFilter.AfterCreateChildElements
If TypeOf parent Is DayNumberUIElement Then Dim day As DayUIElement = TryCast(parent.Parent, DayUIElement) If day.Day.Appointments.Count = 0 Then Exit Sub End If
If day.Day.Appointments.Count > 1 Then Dim objMoreActivityElement As New MoreActivityIndicatorUIElement(parent, day.Date) objMoreActivityElement.Rect = New Rectangle(day.Rect.X - (day.Rect.X * 0.3), day.Rect.Y - (day.Rect.Y * 0.3), 20, 20) day.ChildElements.Add(objMoreActivityElement) day.MoreActivityIndicatorVisible = True End If End If
First of all, tried in BeforeCreateChildElements but not visible and then AfterCreateChildElements where visible but only one indicator over there, rather each day should have indicator where any of appointment is partially visible. The image is attached.
Questions:1. Ultimately, i want the indicator on the day i want. (Meaning, if the height of all appointments on day exceed the day's height)2. How can i change the appearance of indicator button?
Can you please give me a sample code please?
It's Urgent...
Hello Ashish,
Maybe one possible solution could be if you change location of your MoreActivityIndicatioUIElement. I see that you have available space in the left and right side. Another possible approach could be if you create additional MoreActivityIndicatioUIElement with parent DayNumberUIElement. By this way you MoreActivityIndicator will appear in the header of your Day Element.
Let me know if you have any questions.
Hi Georgi, thanks for your valuable reply.
I was done with both of these points. I had wait for your response but didn't get in 2-3 days and finally get the actual result after breaking the brain. Finally did as you suggest, create one list of appointments for the active day and accordingly set the height of the next appointment. Even the suggestion was helpful, thanks you much.
Ya sure, I have another question and its urgent as already i am too late. As i am able to increase the height of appointment and re-positioned properly, but i can't see "MoreActivityIndicator" button after increasing the height even the appointments on that day is hidden or partially hidden. I think the problem because of having an extra height for appointment of its actual height. Please can you modify the attached Creation Filter or give me some other idea about it because i am creating this first time and it takes too much time. Please see the attached creation filter and image for more detail.
Ashish Patel said: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?
The mentioned behavior is expected, because when you increate the height of your first appointment, you didn`t change the Y location of your second appointment. In your scenario you should modify your code (for example Rectangle(editor.Rect.X, editor.Rect.Y, editor.Rect.Width, 35) ) and add additional value to Rect.Y depending of number of your current appointment per day
Ashish Patel said: I want to have non-bold text on every appointment in UltraDayView for both Day view and Work Week View. Is it possible?
There are different approaches to solve this task. Maybe the easiest way could be if you are using AppStyle with desired look and feel. Another possible approach could be if you change VliewStyle of your UltraCalendarLook. The third option could be if you implement DrawFilter.