Dynamic group

3 posts, 0 answers
  1. L
    L avatar
    298 posts
    Member since:
    Apr 2008

    Posted 03 Feb 2012 Link to this post


    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?

  2. L
    L avatar
    298 posts
    Member since:
    Apr 2008

    Posted 03 Feb 2012 Link to this post


    I have found a solution to the question above.

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

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

    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
  3. Ivana
    Ivana avatar
    657 posts

    Posted 07 Feb 2012 Link to this post


    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;
        background-color: Red;
        background-color: Blue;
        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,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top