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

Dynamic group

2 Answers 68 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 03 Feb 2012, 10:52 AM
hi

based on the example you have http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourceheadertemplates/defaultvb.aspx
where your 4 speakers has static settings in the resource style and mapping.

I am having an eviromment where my speakers are very dynamic. we engage many different speakers on an assignment basis and we insert speaker as we engage them and delete them when don't require their speaking engagement.

Grouping is done vertically and we uses Timeline to display speakers on the left without displaying time.

How do i go about it doing dynamically?

Thanks

2 Answers, 1 is accepted

Sort by
0
L
Top achievements
Rank 1
answered on 03 Feb 2012, 05:44 PM
hi

I have found a solution to the question above.

Now, i have a question on Resource Header Template and this is what i have.

<ResourceHeaderTemplate>
    <div id="ResourceDiv" runat="server">
          <asp:Label ID="ResourceLabel" runat="server" BackColor="AliceBlue" Text="Label"></asp:Label>
    </div>             
</ResourceHeaderTemplate>

Protected Sub RadScheduler1_ResourceHeaderCreated(ByVal sender As Object, ByVal e As ResourceHeaderCreatedEventArgs)
        DirectCast(e.Container.FindControl("ResourceLabel"), Label).Text = e.Container.Resource.Text
        DirectCast(e.Container.FindControl("ResourceDiv"), HtmlGenericControl).Style.Add("Background", "Green")
End Sub


I am not able to set each of the resources a different background color. It is now all green.

How do i set each resources a different background color using for loop or while loop? Thanks
0
Ivana
Telerik team
answered on 07 Feb 2012, 02:49 PM
Hello,

You could use the following approach:
protected void RadScheduler1_ResourceHeaderCreated(object sender, ResourceHeaderCreatedEventArgs e)
{
    Label user = e.Container.FindControl("ResourceLabel") as Label;
    user.Text = e.Container.Resource.Text;
    user.CssClass = "class_" + user.Text;
}
.class_Charlie
{
    background-color: Red;
}
.class_Alex
{
    background-color: Blue;
}
.class_Bob
{
    background-color: Yellow;
}
Where Charlie, Alex, and Bob are the users against which the grouping is defined.

You can find out more about  working with resources at the following help article: [http://www.telerik.com/help/aspnet-ajax/scheduler-working-with-resources.html].

I hope this helps.

All the best,
Ivana
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Scheduler
Asked by
L
Top achievements
Rank 1
Answers by
L
Top achievements
Rank 1
Ivana
Telerik team
Share this question
or