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

Advanced template

1 Answer 71 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Philip Saltskog
Top achievements
Rank 2
Philip Saltskog asked on 22 Apr 2009, 07:35 AM
I'm using your example and it works now very good, but I need to get a reference to the usercontrol in the template. How should I do?
                <AdvancedEditTemplate> 
                <scheduler:AdvancedEditForm runat="server" ID="AdvancedEditForm1" Subject='<%# Bind("Subject") %>' 
                    Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' 
                        
                    /> 
                      
            </AdvancedEditTemplate> 
I need to get the reference to "AdvancedEditForm1" from "RadScheduler1". I try this with no result
Dim myForm As AdvancedEditForm = Me.RadScheduler1.TemplateControl.FindControl("AdvancedEditForm1"

I need also set a property in AdvancedEditForm with the name VisibleForFamily (Boolean).
I have in AdvancedForm.aspx a checkbox and I will set it to true or false and reverse, I will get what the user have clicked in the box.

This property is not included in appointment IDatasource so I need to set it in any other way.

/Thanks

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 23 Apr 2009, 12:36 PM
Hello Philip,

Using the sample from this kb article:
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/sample-project-of-the-customizing-the-advanced-template-example.aspx

The code below shows how to find the AdvancedEditForm user control and the Buttons' panel in it:
Protected Sub RadScheduler1_FormCreated(sender As Object, e As SchedulerFormCreatedEventArgs)  
    If e.Container.Mode = SchedulerFormMode.AdvancedEdit Then 
        Dim AdvancedEditForm As UserControl = TryCast(e.Container.FindControl("AdvancedEditForm1"), UserControl)  
        Dim panel1 As Panel = TryCast(AdvancedEditForm.FindControl("ButtonsPanel"), Panel)  
        panel1.BackColor = System.Drawing.Color.Red  
    End If 
End Sub 

Please, try it and let us know if this is what you need.


Regards,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Scheduler
Asked by
Philip Saltskog
Top achievements
Rank 2
Answers by
Peter
Telerik team
Share this question
or