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

[Solved] Insert resource in external window

2 Answers 131 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Nyceane
Top achievements
Rank 1
Nyceane asked on 01 Jan 2008, 02:03 AM
hey,I am trying to update, not really selecting resource in external window, how would I insert my UserID through C# code.  this is from external edit example, I've already searched through this example.  so hwo do you add a resource and update them through RadScheduler1.InsertAppointment(apt)?  or insert the resource seperately.  I just want my UserID to be inserted in there.

            else 
            { 
                // Insert 
                Appointment apt = new Appointment(); 
                apt.Start = aptStart
                apt.End = aptEnd
                apt.Subject = DescriptionText.Text; 
                if (Cache.Get("NewSchedule") != null) 
                { 
                 //how do I update my Resource here?  since its a string, and its keep asking me for a resource. 
                } 
                 
                RadScheduler1.InsertAppointment(apt); 
            } 
 
            ScriptPlaceholder.Text = "GetRadWindow().Close();"

2 Answers, 1 is accepted

Sort by
0
Nyceane
Top achievements
Rank 1
answered on 03 Jan 2008, 03:34 AM
is there anyway to get last key thats inserted from this point?  so that I can insert userID seperately in database.

Thanks
Peter
0
Peter
Telerik team
answered on 04 Jan 2008, 01:22 PM
Hi Nyceane,

Here is an examle how to add a resource at this particular point:
if (Cache.Get("NewSchedule") != null)    
                {    
                 int userID = 1; //The ID of the particular item from the resource.   
                 Resource r = RadScheduler1.Resources.GetResource("Users", userID );  
 
                 apt.Resources.Add(r);  
                }   

Let us know if you experience any problems or if you have questions.


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
Nyceane
Top achievements
Rank 1
Answers by
Nyceane
Top achievements
Rank 1
Peter
Telerik team
Share this question
or