Thanks,
Will
15 Answers, 1 is accepted
Here is one possible solution:
protected void RadScheduler1_FormCreated(object sender, Telerik.Web.UI.SchedulerFormCreatedEventArgs e) |
{ |
if (e.Container.Mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) |
{ |
//Disable the basic and advanced control panels: |
Panel basicControlPanel = (Panel)e.Container.FindControl("BasicControlsPanel"); |
basicControlPanel.Enabled = false; |
Panel advancedControlPanel = (Panel)e.Container.FindControl("AdvancedControlsPanel"); |
advancedControlPanel.Enabled = false; |
//Hide the Update button |
LinkButton updateButton1 = (LinkButton)e.Container.FindControl("_updateButton"); |
updateButton1.Visible = false; |
//Rename the Cancel button |
LinkButton cancelButton = (LinkButton)e.Container.FindControl("cancel"); |
cancelButton.Text = "Close"; |
} |
} |
Let us know if you have any other questions.
Regards,
Peter
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thanks for your response. I am using the advanced edit template for the detail view in a manner similar to the code you posted. However, the issue I’m trying to overcome is that the user is not able view the advanced edit when appointment.AllowEdit is set to false. Double clicking does not send the event to the server. If I understand your solution correctly, it depends on the user being able to view the advanced edit template somehow. How is this accomplished when edit is disabled on the appointment?
Thanks,
Will
Sorry for not being specific enought with the suggested solution. With this approach, you should not set appointment.AllowEdit to false. In the FormCreated event I find the controls in the default advanced form and set properties such as Enabled, Visible and Text. This way I disable the basic and advanced control panels, hide the update button and change the text of the cancel button to "close". Please, let me know if I have to provide more details.
Peter
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thanks, and I appreciate your patience,
Will
Setting properties of controls in the default advanced form will in no way affect moving and resizing the appointment. I suggest you try the code which I sent you and see for yourself what it does. :-)
Cheers,
Peter
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thanks,
Will
I thought you wanted to preserve the ability to move or resize the appointment. If you want to disable these two operations, please use the following approach:
<script type="text/javascript"> |
function OnClientAppointmentMovingHandler(sender, eventArgs) |
{ |
eventArgs.set_cancel(true); |
} |
function OnClientAppointmentResizingHandler(sender, eventArgs) |
{ |
eventArgs.set_cancel(true); |
} |
</script> |
<telerik:RadScheduler ID="RadScheduler1" runat="server" |
OnClientAppointmentMoving="OnClientAppointmentMovingHandler" |
OnClientAppointmentResizing="OnClientAppointmentResizingHandler" |
Cheers,
Peter
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Adding in this bit of CSS solved that:
.rsAptResize { |
cursor:default !important; |
} |
I added the OnClientAppointmentDoubleClick property to my instance of RadScheduler. This launches my popup, but then the form always posts back, so I see my popup for about three seconds before the page refreshes. I tried adding eventArgs.set_cancel(true); like in your example, and it worked... sort of. Sadly, it only worked because it caused a JavaScript error that prevented the page from posting back.
Here's my sample code... If you run it and click on an appointment, you'll get an alert. When you click OK, the page will post back and display an edit form. I want to prevent the postback from happening. From your documentation (http://www.telerik.com/help/aspnet-ajax/schedule_clientsideonclientappointmentdoubleclick.html), I see that eventArgs only has one method, so perhaps this isn't possible?
<script type="text/javascript">
function appointmentDoubleClick(sender, eventArgs)
{
var apt = eventArgs.get_appointment();
alert('id=' + apt.get_id()); //my version pops up a page, but the alert will demo the behavior
//eventArgs.set_cancel(true); //commented out because it raises an error
}
</script>
<telerik:RadScheduler ID="calendar" runat="server" OnClientAppointmentDoubleClick="appointmentDoubleClick"
HoursPanelTimeFormat="htt" ValidationGroup="calendar" OnAppointmentDataBound="calendar_AppointmentDataBound">
</telerik:RadScheduler>
This is error is expected since OnClientAppointmentDoubleClick cannot be canceled and therefore it does not have the set_cancel() method for the eventArg. Please, try using OnClientAppointmentEditing instead in the same way you used OnClientAppointmentDoubleClick.
Regards,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
- To get the event of the click on the server:
RadScheduler1_AppointmentClick
- And to basic edit form at all:
protected void RadScheduler1_FormCreated(object sender, Telerik.Web.UI.SchedulerFormCreatedEventArgs e)
{
if (e.Container.Mode == Telerik.Web.UI.SchedulerFormMode.Edit)
{
e.Container.Visible = false;
}
}
I hope it helps to someone.....
<script type="text/javascript" language="javascript"> |
function ClientAppointmentDoubleClick(sender, eventArgs) { |
var apt = eventArgs.get_appointment(); |
alert("You double-clicked on an appointment with the subject: " + apt.get_subject()); |
} |
// Prevents opening of the in-built edit form |
function ClientAppointmentEditing(sender, eventArgs) { |
eventArgs.set_cancel(true); |
} |
</script> |
Protected
Sub SubRadScheduler1_FormCreated(ByVal sender As Object, ByVal e As SchedulerFormCreatedEventArgs) Handles RadScheduler1.FormCreated
If e.Container.Mode = Telerik.Web.UI.SchedulerFormMode.AdvancedEdit Then
e.Container.Visible =
False
End If
End Sub
Hi,
I have Created My Customized Scheduler, And add the events from A button click outside the Scheduler. On Button click i opened a popup.The event is created. But Wen i want to edit that event in scheduler,its own popup open, not mine.. please give me the suggestion What can i do?