I need to customize each appointments image, background color and bar color. The appointments are bound to my dataset during the load and I would like to bind the Tag property to my CustomerData so that I can refer to those values in the AppointmentDataInitialized event. This is not working..
Me.ultraCalendarInfo1.DataBindingsForAppointments.Tag = "CustomData"
I have a calendar with 6k+ appointments and was originally using the DataKey to do a lookup in the AppointmentDataInitialized event, but that lookup is too costly. I’ve tested by storing my CustomData in the SubjectMember to make sure I will get better performance, and I do.
I imagine I’m missing something, so can you point me in the right direction. I’m using VB.NET
Thanks!
Deb
Hello Deb,
ultraCalendarInfo1.DataBindingsForAppointments.Tag property is just a Tag for Appointment. Tag object cannot be used for databinding. Using the DataKey to do a look up is the possible way and by limiting this look up to visible appointments you can get better performance. This can be done by getting the VisibleAppoinbtments collection in the AppointmentDataIntialized event and just doing the lookup within these appointments.
You can submit this as a product idea at <http://ideas.infragistics.com>. Please note that, if it gets enough votes to be implemented as a new feature the earliest release it can be included is 18.1.
Please let me know if you need more information.
Sincerely,Sahaja KokkalagaddaAssociate Software Developer
Thanks Sahaja. Can you provide a vb.net code example for targeting only the VisibleAppointments collection within the AppointmentDataInitialized event.
Thanks,
There is a possibility of getting VisibleAppointments collection by doing something like this:
Dim visibleAppointments As List(Of Appointment) = New List(Of Appointment) For Each aptmnt As Appointment In UltraCalendarInfo1.Appointments
If aptmnt.Visible = True Then visibleAppointments.Add(aptmnt)
Next
Once you have the visible appointments then you can use the DataKey to do the look up through these appointments to get better performance.
Please let me know if I may be of further assistance.
Hi Sahaja,
This does not help or maybe I’m not understanding. Let me outline what is happening in my code:
I load my data and setup the binding to my UltraCalendarInfo object. Once I call the BindingsForAppointments.RefreshData, the AppointmentDataInitialized is called once for each appointment in my dataset. All of my appointments are considered visible since I don’t know which calendar view they are using.
As I mentioned, I have code in the AppointmentDataInitialized which does a lookup for every appointment and that is where I'm taking the performance hit.
Is there a different way to set my appointment image and color attributes?
Me.ultraCalendarInfo1.DataBindingsForAppointments.BindingContextControl = Me
Me.ultraCalendarInfo1.DataBindingsForAppointments.BindingContext = Me.BindingContext
Me.ultraCalendarInfo1.DataBindingsForAppointments.SubjectMember = "TimeNote"
Me.ultraCalendarInfo1.DataBindingsForAppointments.DescriptionMember = "Description"
Me.ultraCalendarInfo1.DataBindingsForAppointments.StartDateTimeMember = "ScheduleStartDateTime"
Me.ultraCalendarInfo1.DataBindingsForAppointments.EndDateTimeMember = "ScheduleEndDateTime"
Me.ultraCalendarInfo1.DataBindingsForAppointments.AllDayEventMember = "AllDayEvent"
Me.ultraCalendarInfo1.DataBindingsForAppointments.OwnerKeyMember = "FIDEmployee"
Me.ultraCalendarInfo1.DataBindingsForAppointments.AllPropertiesMember = "AllProperties"
Me.ultraCalendarInfo1.DataBindingsForAppointments.DataKeyMember = "PIDWorkOrderSchedule"
Me.ultraCalendarInfo1.DataBindingsForAppointments.SetDataBinding(dataset1, "WorkOrderSchedule")
Me.ultraCalendarInfo1.AppointmentActionsEnabled = True
---This triggers the ultraCalendarInfo1_AppointmentDataInitialized once for each appointment. They are all visible at this time.
ultraCalendarInfo1.DataBindingsForAppointments.RefreshData()
Visible appointments list can be retrieved from the view if the underlying control is known. However, if the control’s being used are unknown this approach will not work.
After investigating for a property that can be used to customize an Appointment and doing some research, adding such property has been determined to be a product idea. You can suggest new product ideas for future versions (or vote for existing ones) at <http://ideas.infragistics.com>.
Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. You can also link back to this thread for additional details.
Thank you in advance to submitting your product idea.