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 take a look on the code below:
Public Class CreationUIElement
Implements IUIElementCreationFilter
Public Sub AfterCreateChildElements(parent As UIElement)
' 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)
End If
' How to add a new MoreActivityIndicators in the DayNumberUIElement
' on specfici date
Dim El As DayNumberUIElement = TryCast(parent, DayNumberUIElement)
If El IsNot Nothing AndAlso El.Parent.[GetType]() = GetType(DayUIElement) AndAlso DirectCast(El.Parent, DayUIElement).[Date] > DateTime.Today.AddDays(5) Then
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);
'}
End Sub
Public Function BeforeCreateChildElements(parent As UIElement) As Boolean
Return False
End Function
End Class
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:
Let me know if you have any questions
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.
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.
Thank you
If El IsNot Nothing Then
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, 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.