Custom Resource Group Header Styles?

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    48 posts
    Member since:
    Apr 2012

    Posted 17 Jun 2014 Link to this post

    I need to modify the style of the group header but can't seem to do it. I can modify the font, but it also seems to modify the font of the appointments as well.
    Dim SchedElement As SchedulerDayViewGroupedByResourceElement = RadScheduler1.GetDayView.Scheduler.SchedulerElement.ViewElement
    SchedElement.Font = New Font("Segoe UI", 10, FontStyle.Regular, GraphicsUnit.Point)
    SchedElement.ForeColor = Color.White
    SchedElement.ResourceHeaderHeight = 35
    SchedElement.ResourcesHeader.BackColor = Color.FromArgb(0, 159, 60)
    SchedElement.ResourcesHeader.BackColor2 = Color.FromArgb(0, 159, 60)
    Anything that sets a "ResourceHeader" doesn't seem to do what I am expecting. The attached picture shows the header I am trying to modify as well as what RadControlSpy says about it.
  2. Ralitsa
    Ralitsa avatar
    181 posts

    Posted 19 Jun 2014 Link to this post

    Hi Jeff,

    Thank you for contacting us. 

    If you want to change the color of resource, you need to change the Color of one resource or all resources. Please take a look at the following code example: 

    1. Change the color of one resource: 
    Me.RadScheduler1.Resources(1).Color = Color.BlueViolet

    2. Change the color of all resources:    
    Dim colors() As Color = {Color.LightBlue, Color.LightGreen, Color.LightYellow, Color.Red, Color.Orange, Color.Pink, Color.Purple, Color.Peru, Color.PowderBlue}
            Dim names() As String = {"Alan Smith", "Anne Dodsworth", "Boyan Mastoni", "Richard Duncan", "Maria Shnaider"}
            For i As Integer = 0 To names.Length - 1
                Dim resource As New Telerik.WinControls.UI.Resource()
                resource.Id = New EventId(i)
                resource.Name = names(i)
                'set to each resource different color
                'resource.Color = colors(i)
                'set to each resource one color
                resource.Color = Color.FromArgb(0, 159, 60)
            Next i

    I attached a sample demo project which demonstrates you how to change the color of resource. 

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top