This is a migrated thread and some comments may be shown as answers.

Timeline-View and Backcolor of Group-Headers

2 Answers 87 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jürgen
Top achievements
Rank 1
Jürgen asked on 26 Jul 2013, 03:13 PM
Hello to all,

My customer wants in timeline-view a change of background color behind die Group-Headers (at the left side of the Scheduler).
In the attached picture its the area which the arrows on top and bottom.

The resourcetype depends to a SqlDatasource and my idea was a own field in this SqlDataSource with die color-value as Integer.

Is this possible?
I'm writing in VB.

I've just implemented coloring of appointments based on values of a SqldataSource.

Thank to all!
Jürgen

2 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 29 Jul 2013, 08:52 AM
Hi Jürgen,

 
You can achieve this in a similar why it is done in this on-line demo
Here is the code that can just change the background without the need of and image for example:

<telerik:RadScheduler runat="server" ID="RadScheduler1" GroupBy="User"
         SelectedView="TimelineView" GroupingDirection="Vertical" OnResourceHeaderCreated="RadScheduler1_ResourceHeaderCreated"   
        <ResourceHeaderTemplate>
                <asp:Panel ID="ResourceImageWrapper" runat="server" >
                  <asp:Literal runat="server" ID="ResourceName"></asp:Literal>
                </asp:Panel>
            </ResourceHeaderTemplate>       
    </telerik:RadScheduler>

Protected Sub RadScheduler1_ResourceHeaderCreated(sender As Object, e As ResourceHeaderCreatedEventArgs)
    Dim ResourceImageWrapper As Panel = TryCast(e.Container.FindControl("ResourceImageWrapper"), Panel)
    ResourceImageWrapper.CssClass = "Resource" + e.Container.Resource.Key.ToString()
    Dim resourceName As Literal = TryCast(ResourceImageWrapper.FindControl("ResourceName"), Literal)
    resourceName.Text = e.Container.Resource.Text.ToString()
End Sub
<style type="text/css">
       .Resource1 {
       background-color:black;
       }
       .Resource2 {
       background-color:red;
       }
       .Resource3 {
       background-color:yellow;
       }
   </style>

Hope this will be helpful.

Regards,
Plamen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Jürgen
Top achievements
Rank 1
answered on 30 Jul 2013, 05:54 AM
Hi Palmen,

thanks for help, it works.

Best regards,

Jürgen
Tags
Scheduler
Asked by
Jürgen
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Jürgen
Top achievements
Rank 1
Share this question
or