Hello,
I have found a way to change the timeslot color for a certain time period on the dayview using the code below however when I switch to the week view the red color doesn't show up. How would I change the timeslot color in the ultraweekview since there is no timeslot property link in ultradayview
For Each slot As TimeSlot In actDayView.TimeSlots
If slot.StartTime.Hour > 10 AndAlso slot.EndTime.Hour < 13 Then
slot.WorkingHourAppearance.BackColor =Color.Red
End If
Next
Hello Matthew,
Thank you for posting in Infragistics forum.
Could you please provide us with more details and mockup screenshot, which is showing what are you trying to achieve.
Please do not hesitate to contact us if you have any other question with this matter.
So for just a bit more detail I want to be able to change the color of certain time slots so that I can mark that as Sales Time, or Accounting time, so I can basically section off pieces of my day for certain types of work and I thought color coding would work well, that way I can still schedule appointments in those areas but it allows me to visually see what type of work I should be doing. The first screen shot below shows what I have gotten to work so far, on the day view I was able to change a certain time periond to have a different color of time slots as show below, however when I switch to my week view as you can see the change does not translate over, and when I try to modify the timeslots of the week view I have no clue how to do that, the code above only seems to work for the dayview.
Perfect that is exactly what I want it to do, just wondering how do I put the label on a specific time slot and not on all of them like in your example. So that in the code below after I color the timeslot red it adds the label.
For Each slot As TimeSlot In DayView.TimeSlots
slot.WorkingHourAppearance.BackColor = Color.Red
(THIS IS WHERE I WOULD ADD THE LABEL TO THE TIMESLOT)
Hi Matthew,
A possible approach to achieve your goal is to use the follwing code:
If TypeOf parent Is TimeSlotUIElement Then
Dim slotUI As TimeSlotUIElement = DirectCast(Parent, TimeSlotUIElement)
If DirectCast(slotUI.GetContext(), TimeSlot).StartTime.Hour > 10 AndAlso DirectCast(slotUI.GetContext(), TimeSlot).EndTime.Hour < 13 Then
Dim t As New TextUIElement(Parent, "Hello this is my custom text")
t.Rect = New System.Drawing.Rectangle(parent.Rect.X + 10, parent.Rect.Y, parent.Rect.Width, parent.Rect.Height)
parent.ChildElements.Add(t)
Please do not hesitate to contact us if you still have any other question related to this matter.
I am checking about the progress of this issue. Please let me know If you need any further assistance on this.
Ok sorry to keep bugging you but this is the last hurdle I am facing. I am using the UltraDayView and the visibledays property to create a work week look showing 5 business days as shown by the image below. When I use the code below it colors the same time slots red on each day, how would I just change the timeslot color for a specific day, I am just not sure how to do this.
For each slot as TimeSlot in actdayView.Timeslots
if slot.StartTime.Hour > 10 AndAlso slot.Endtime.Hour < 13 then
I believe that this could be achieved through the 'TimeRangeAppearances'.Please take a look at the following link and let me know if you need any additional assistance: http://help.infragistics.com/Help/NetAdvantage/WinForms/2013.1/CLR4.0/html/Infragistics4.Win.UltraWinSchedule.v13.1~Infragistics.Win.UltraWinSchedule.OwnerTimeSlotSettings~TimeRangeAppearances.html.
Hello Matt,
I wanted to know if you were able to solve your issue based on these suggestions or you still need help. Please let me know.
You might need to set the 'GroupingStyle' enumeration on the 'UltraDayView' to the 'OwnerWithinDate' member for example, in order to get this to work.
I have attached a small example project which shows what the above article is all about. Please take a look at it and let me know if you need any additional assistance.
That seems like exactly what I need, but for some reason i cannot get it to work, if possible could you attach an example project showing how it works?
Matt