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

Prepopulating RadScheduler with Data

1 Answer 95 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Royal
Top achievements
Rank 1
Royal asked on 20 Mar 2009, 04:30 PM
I am looking to take some basic customer information (name, address, phone number) from a recordset and have it prepopulate a RadScheduler entry.

What would be the best way to achieve this?

Thanks

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 23 Mar 2009, 11:40 AM

Custom attributes seem the most logical choice for this case. If you need to open the advanced form and prepopulate the fields there, you should use FormCreated as shown in this kb article:

http://www.telerik.com/support/kb/aspnet-ajax/scheduler/how-to-access-controls-in-the-advanced-form.aspx

For example:

<telerik:RadScheduler ID="RadScheduler1" runat="server" 
        CustomAttributeNames="Annotations"   
        EnableCustomAttributeEditing="true" ... > 
* * * 


protected void RadScheduler1_FormCreated(object sender, Telerik.Web.UI.SchedulerFormCreatedEventArgs e)  
    {  
        if (e.Container.Mode == SchedulerFormMode.AdvancedEdit || e.Container.Mode == SchedulerFormMode.AdvancedInsert)  
        {  
            TextBox attrAnnotationsTextbox = (TextBox)e.Container.FindControl("AttrAnnotations");  
            attrAnnotationsTextbox.Text = "custom text prepopulated";  
        }  
    }  
    //Or, if you do not need to display the advanced form, you can prepopulate the attributes in   
    //AppointmentInsert  
    protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)  
    {  
        e.Appointment.Attributes["Annotations"] = "custom text prepolutated in insert";  
    } 

If you want to prepopulate the fields without using the advanced form, then handle AppointmentInsert as shown above.


Kind regards,
Peter
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
Royal
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or