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

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

2 Answers 67 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Teija
Top achievements
Rank 1
Teija asked on 27 May 2010, 05:11 PM
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 Answers, 1 is accepted

Sort by
0
Brian Mains
Top achievements
Rank 1
answered on 27 May 2010, 06:58 PM
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.
0
Peter
Telerik team
answered on 28 May 2010, 03:39 PM
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.
Tags
Scheduler
Asked by
Teija
Top achievements
Rank 1
Answers by
Brian Mains
Top achievements
Rank 1
Peter
Telerik team
Share this question
or