views:

1516

answers:

2

I'm trying to utilize the RadScheduler component from Telerik for a public facing website, and do not want a user to be able to edit the details of the events on the calendar, but would like them to be able to double click on the event to see the details.

How is this achieved?

Here is my current code for the scheduler:

<telerik:RadScheduler ID="RadScheduler1" runat="server" AllowDelete="False"
    AllowEdit="True" AllowInsert="False" Skin="Vista" OnDataBound="RadScheduler1_DataBound"
    OnInit="RadScheduler1_Init" HoursPanelTimeFormat="htt" ValidationGroup="RadScheduler1"
    Height="600px" SelectedView="MonthView" Width="100%" ProviderName="XmlSchedulerProvider1">
    <Localization AdvancedAllDayEvent="All day"></Localization>
    <AdvancedForm DateFormat="M/d/yyyy" TimeFormat="h:mm tt" Modal="True"></AdvancedForm>
    <TimelineView UserSelectable="False" />
    <DayView UserSelectable="False" ReadOnly="True" />
</telerik:RadScheduler>

I've found that setting AllowEdit="False" prevents the entire modal from coming up with the event details.

+2  A: 

If you are using AdvancedEditTemplate or InlineEditTemplate, you can disable or hide controls in the RadScheduler1.FormCreated event. Insert and Edit modes are detected with e.Container.Mode.

VB example:

Protected Sub RadScheduler1_FormCreated(ByVal sender As Object, ByVal e As SchedulerFormCreatedEventArgs) Handles RadScheduler1.FormCreated
    If ((e.Container.Mode = SchedulerFormMode.AdvancedEdit)) Then

        //Disable controls, hide update button
        Dim cmdUpdate As LinkButton = DirectCast(e.Container.FindControl("UpdateButton"), LinkButton)
        cmdUpdate.Visible = False

       End If
End Sub

In my opinion, working with advanced form templates is the most time consuming part in using the Scheduler. In this case, it is probably sufficient to access the default advanced form controls and disable or hide them. But you can also customize the default advanced form templates of or even replace them with your own. The source code for the default template is found in the install directory under:

\Live Demos\Scheduler\Examples\AdvancedFormTemplate\DefaultTemplates
mika
Thanks, this looks promising. Trying it out now.
RSolberg
A: 

Remove the update and insert datasources and parameters from the form. Otherwise, even with the suggestion from above, someone will be able to drag /drop an appointment to a new time slot or create a new one.

Dave McD