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.
Hello Ashish,
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.
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.
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, thanks for quick reply.
I agreed and appreciate your answer. I have tried with your sample and able to show indicator on DayHeader area but an ActivityIndicator is showing for only those day where it was already exist, we just change the location. Actually i want it on every day whether that day has appointments or not and accordingly i will show/hide AcivityIndicator in AfterCreateChildElements() method if possible.
For this, i tried to add Office2007MoreActivityIndicator to DayNumberUIElement for the related date in BeforeCreateChildElements() method. The sample code is attached.
In BeforeCreateChildElements, here
dayHeader = DayNumberUIElements
day = DayUIElement
Dim objMoreActivityElement As New Office2007MoreActivityIndicatorUIElement(dayHeader, day.Date)
objMoreActivityElement.Rect = New Rectangle(dayHeader.Rect.X + dayHeader.Rect.Width - dayHeader.Rect.Width, dayHeader.Rect.Y + 2, objMoreActivityElement.Rect.Width, objMoreActivityElement.Rect.Height) dayHeader.ChildElements.Add(objMoreActivityElement)
An above code nothing affects to control. Even the position of indicators are not changed. So, can i add an ActivityIndicator to every day and can show/hide when i want. Can you please give me a proper sample for how to add ActivityIndicator and how to show/hide them because if i set objDayUIElement.MoreActivityIndicatorVisible property to true or false in any method(After/Before), it doesn't affect.
I apologies for any mistakes or misunderstandings.
Thank you
Please take a look on the code below:
Dim El As DayNumberUIElement = TryCast(parent, DayNumberUIElement)
Dim mIndicator As New Office2007MoreActivityIndicatorUIElement(El, DirectCast(El.Parent, DayUIElement).[Date])
mIndicator.Rect = New Rectangle(El.Rect.X + El.Rect.Width - 10, El.Rect.Y + 2, 10, 10)
El.ChildElements.Add(mIndicator)
'Office2007MoreActivityIndicatorUIElement El = parent as Office2007MoreActivityIndicatorUIElement;
'if (El != null)
'{
' var aa = El.GetAncestor(typeof(WeekUIElement)).GetDescendant(typeof(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);
'}
Using this code you will be able to add MoreActivityIndicator to each Day. If you want to Show/Hide specific Indicator on a specific Day, you should extend the IF condition ( If El IsNot Nothing Then) per your requirements.
Regards
Hi Georgi, that was awesome. It is working fine. One last question, hope not problematic for you.
Using your code, i am able to add Indicator to all the days, but as i mentioned in my last post that i want to hide it for some of the days. I have tried lot using objDayUIElement.MoreActivityIndicatorVisible = False , but its not working. After adding indicator to all the days. even it shows the old indicator that the control already shows when any of the appointment goes hidden or partially hidden. I want to just know that is it possible to hide indicator for some of the days and how to hide the control's default indicator as use my own i that you have provided in last post. See the attached image. That's it.
Hopefully this may be the last post regarding this issue from my end.
Hi Georgi,
I am able to solve it. Thanks for all your valuable replies. I am adding the sample code in order to use for users like me, although i just want to tell you that make sure the "objDayUIElement.MoreActivityIndicatorVisible" is implemented in V10.3 because till now i have not found to hide an indicator. So please check it and if so, then please send the feature request to your development department. And one more thing, if possible, can you give us the quick reply if urgent is specified in the post, please.
' How to hide default MoreActivityIndicator
Dim OldIndicator As Office2007MoreActivityIndicatorUIElement = TryCast(parent, Office2007MoreActivityIndicatorUIElement)
If OldIndicator IsNot Nothing AndAlso OldIndicator.Parent.[GetType]() <> GetType(DayNumberUIElement) Then
OldIndicator.Rect = New Rectangle(OldIndicator.Rect.X, OldIndicator.Rect.Y, 0, 0)
' How to add a new MoreActivityIndicators in the DayNumberUIElement
' on specfici date
If El IsNot Nothing AndAlso El.Parent.[GetType]() = GetType(DayUIElement) AndAlso DirectCast(El.Parent, DayUIElement).[Date] > DateTime.Today.AddDays(5) Then
Using this piece of code:
you will be able to hide all default indicators, nevertheless of appointments
The next part of my code, will create Indicators in the headers. If you want to create indicators only for specific dates, you could extend IF condition. For example: