Where can I find an example of howto add resources manually from code

3 posts, 0 answers
  1. Teija
    Teija avatar
    23 posts
    Member since:
    Oct 2008

    Posted 27 May 2010 Link to this post

    Hi

    Where can I find an example of howto add resources manually from code?
    All examples I've found contains a ResourceType with a DataSource. I have a couple of resources I want to add manually from code that I want to be able to group by later in the scheduler.
    Does somebody know anything that can be at help?

    /Mathias
  2. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 27 May 2010 Link to this post

    Can you go the custom provider route (http://www.telerik.com/community/forums/reply-thread.aspx?messageId=0&threadId=313987)?  That would give you the ability to programmably change the list in the GetResources and GetResourcesByType methods.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 28 May 2010 Link to this post

    Hello Mathias,

    Try the following code:
    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"));
    }


    Greetings,
    Peter
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top