Using Session as ResourceType

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

    Posted 23 Apr 2011 Link to this post

    hi

    Based on your example http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourceavailability/defaultcs.aspx

    My users are login based on username and password, and their username is assign to a session variable.

    How do i use this session variable in the resourcetype instead of using DataSourceID? Thanks

     <ResourceTypes>
                 <telerik:ResourceType KeyField="ID" Name="User" TextField="UserName" ForeignKeyField="UserID"
                     DataSourceID="UsersDataSource" />
    </ResourceTypes>
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 25 Apr 2011 Link to this post

    Hi L,

    You can add resources and resource types from code behind like this:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadScheduler1.ResourceTypes.Add(new ResourceType("User"));
        RadScheduler1.Resources.Add(new Resource("User", "1", "Alex"));
        RadScheduler1.Resources.Add(new Resource("User", "2", "Bob"));
        RadScheduler1.Resources.Add(new Resource("User", "3", "Charlie"));
    }

    Does this help you with your task?

    Greetings,
    Peter
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top