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

My Advance Form

17 Answers 262 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Abdul
Top achievements
Rank 1
Abdul asked on 02 Dec 2010, 08:49 AM
I have created my own advanced form "AdvForm.ascx"

At the top of my .aspx file i have put:

<%@ Register  tagprefix="schedular" tagname="AdvForm"  src="AdvForm.ascx"%>

Then further down in the scheduler i have put the following:

<script type="text/javascript">   
        //<![CDATA[
 
            // Dictionary containing the advanced template client object
         // for a given RadScheduler instance (the control ID is used as key).
         var schedulerTemplates = {};
         
         function schedulerFormCreated(scheduler, eventArgs) {
         // Create a client-side object only for the advanced templates
         var mode = eventArgs.get_mode();
         if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert ||
                    mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
         // Initialize the client-side object for the advanced form
         var formElement = eventArgs.get_formElement();   
         var templateKey = scheduler.get_id() + "_" + mode;
         var advancedTemplate = schedulerTemplates[templateKey];
         if (!advancedTemplate)
         {
         // Initialize the template for this RadScheduler instance
         // and cache it in the schedulerTemplates dictionary
     var schedulerElement = scheduler.get_element();
     var isModal = scheduler.get_advancedFormSettings().modal;
     advancedTemplate = new window.SchedulerAdvancedTemplate(schedulerElement, formElement, isModal);
     advancedTemplate.initialize();
 
     schedulerTemplates[templateKey] = advancedTemplate;
 
                        // Remove the template object from the dictionary on dispose.
     scheduler.add_disposing(function() {
                            schedulerTemplates[templateKey] = null;
     });
         }
 
         // Are we using Web Service data binding?
         if (!scheduler.get_webServiceSettings().get_isEmpty()) {
         // Populate the form with the appointment data
         var apt = eventArgs.get_appointment();
         var isInsert = mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert;
         advancedTemplate.populate(apt, isInsert);
         }
         }
         }
             
        //]]>
        </script>
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        <scripts>
                <asp:ScriptReference Path="AdvancedForm.js" />
            </scripts>
        </telerik:RadScriptManager>
         
            
        <br />
        <telerik:RadScheduler ID="RadScheduler1" runat="server" EnableAdvancedForm="true"
            EnableDescriptionField="true" OnClientFormCreated="schedulerFormCreated">
             
            <AdvancedForm Modal="true" />
              <AdvancedInsertTemplate>
                
                 <schedular:AdvForm ID="AdvForm1" runat="server" Mode="Insert" />
                   
             </AdvancedInsertTemplate>
             
             
        </telerik:RadScheduler>
Is anyone able to tell me whey when i double click on the scheduler in run-time i.e. add appointment, nothing happens? That is the advanced form control is not popping up.

17 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 02 Dec 2010, 11:49 AM
Hello Abdul,

Registering the advanced form and adding the user control in the page is not enough. You'll need to add bindable properties in the advanced form and use bind expressions for them in the markup. Here's an example:

<AdvancedEditTemplate>
                <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit"
                    Subject='<%# Bind("Subject") %>'
                    Description='<%# Bind("Description") %>' 
                    Start='<%# Bind("Start") %>'
                    End='<%# Bind("End") %>'
                    RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
                       Reminder='<%# Bind("Reminder") %>'
                    AppointmentColor='<%# Bind("AppointmentColor") %>' 
                    UserID='<%# Bind("User") %>'
                    RoomID='<%# Bind("Room") %>' />
            </AdvancedEditTemplate>
            <AdvancedInsertTemplate>
                <scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Insert"
                    Subject='<%# Bind("Subject") %>'
                    Start='<%# Bind("Start") %>'
                    End='<%# Bind("End") %>'
                    Description='<%# Bind("Description") %>'
                    RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
                       Reminder='<%# Bind("Reminder") %>'
                    AppointmentColor='<%# Bind("AppointmentColor") %>' 
                    UserID='<%# Bind("User") %>'
                    RoomID='<%# Bind("Room") %>' />
            </AdvancedInsertTemplate>

Please take a look at this demo for more information.

Feel free to ask me if you have further questions.

Greetings,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Abdul
Top achievements
Rank 1
answered on 03 Dec 2010, 06:23 AM
I'm trying to solve this according to you but the problem is that an error occured

Error:  Two-way binding is only supported for properties. 'Subject' is not a valid property on 'advform_ascx' 
0
Abdul
Top achievements
Rank 1
answered on 03 Dec 2010, 07:20 AM
Please help me how can i bind these fields to the SQL Server DataBase in Appointment Tables my Appointment Table is according to your Data Structure.
0
Veronica
Telerik team
answered on 03 Dec 2010, 02:41 PM
Hello Abdul,

You'll need to add bindable property "Subject" in the code-behind of the Advanced Form user control. Here's an example:

[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
    public string Subject
    {
        get
        {
            return SubjectText.Text;
        }
  
        set
        {
            SubjectText.Text = value;
        }
    }

Please send me your project so I can inspect it and help you.

Kind regards,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Abdul
Top achievements
Rank 1
answered on 04 Dec 2010, 07:51 AM

here my project but i can't handle it.
i'm using DBAccess class file for SQL Connection all methods are already implented in my class and sucessfully worked
please help me according to my terms and condition thank you.
0
Abdul
Top achievements
Rank 1
answered on 04 Dec 2010, 07:57 AM
I'm trying to create an advance form and in this form i can select department dropdown list according to department users of another dropdown can be filled automatically for example i'm select accounts department the users of accouts department can be populated and select finance department the users of finance department can be populated in users dropdown please help me i'm in trouble.thank you
0
Veronica
Telerik team
answered on 09 Dec 2010, 10:46 AM
Hello Abdul,

Unfortunately I can not investigate your code as you have attached pictures. Have you looked at the project that I made for you in this forum post?

Merge your code with my project and tell me how it goes.
 
Best wishes,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
roshani
Top achievements
Rank 1
answered on 10 Dec 2010, 09:43 AM
Hello Admin,

I am developing a demo application using the telerik trial version. In the application, I have used the advance form shown in the attached documant. There are two types of resources -Instructor and student. My requirement is that when one will select the instructor from the dropdown in the advance form, the student dropdwon shoul be populated with students related to the selected instructor.
Please provide the guidance for this functinality as soon as possible. I have to implement similar in the live application.

Thanks and Regards,
Roshani
0
roshani
Top achievements
Rank 1
answered on 14 Dec 2010, 08:53 AM
Hello Admin,

For the functinality mentioned in the above post, I also tried using the Custom advance form but still it is not working. Is it possible just to add a event the script that is fired when a instructor is selected from the Istructor resouce control ? Plz provide the guidance as soon as possible.
I have attached a screenshot in the above post.
Waiting for your reply...

Thanks and Regards,
Roshani
0
Veronica
Telerik team
answered on 16 Dec 2010, 10:20 AM
Hello roshani,

Please take a look at this demo for multi valued resources.

Feel free to ask me if you have further questions.

All the best,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
roshani
Top achievements
Rank 1
answered on 16 Dec 2010, 11:49 AM
Thanks for the reply.

I have gone through the demo. My requirement is little bit different.

In our scenario Admin and Instructors will make the appointments.
For the Instructor it will be quite easy to implement because there will be only one resource i.e. Student.
But for Admin, there will be two types of resources - Instructor and Student
Now the requirement is that when  admin selects the Instructor from Instructor dropdown, another (resource control) Student dropdown must be populated with the students of the selected instructor.

Is there any way to achieve this?

Thanks and regards,
roshani
0
roshani
Top achievements
Rank 1
answered on 16 Dec 2010, 12:34 PM
Hello,

I found this demo project from one of the forums 234043_customadvformandprovider.zip. It is quite useful for me, but it doesn't work on my machine. It gives following error.


A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Source Error:

Line 255:        List<Resource> resources = new List<Resource>();
Line 256:
Line 257:        using (DbConnection conn = OpenConnection())
Line 258:        {
Line 259:            DbCommand cmd = DbFactory.CreateCommand();


Also I found that this demo project also contains two resources Teacher and student as in our project. The only difference is that it fetches all the students and in our case, we want to fetch the students of the selected instructor. Can you please suggest some modification to achieve this functionality?

Thanks in advance,
Roshani
0
Veronica
Telerik team
answered on 16 Dec 2010, 02:30 PM
Hi roshani,

I tried to open the demo and it run successfully on my machine.

Please make sure that the connection string is correct.

Regards,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Balaji
Top achievements
Rank 1
answered on 06 Dec 2011, 10:21 AM
Hi,

I want to know whether the radscheduler advance form resource type have change event. I want to set the resource drop down item change event. Can anyone plz give me a suggestion for how to use the change event.
0
Peter
Telerik team
answered on 06 Dec 2011, 04:27 PM
Hi Balaji,

You can use the Advanced Templates as shown in this demo. In the ResourceControl user control you can attach to SelectedIndexChanged event.

All the best,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Balaji
Top achievements
Rank 1
answered on 07 Dec 2011, 05:47 AM
Hi peter,

Thanks for the link. But, I didn't see any change event in resource type. Can you please post some other example or explained it detail. It could be great you give the solution quickly.
0
Peter
Telerik team
answered on 07 Dec 2011, 03:53 PM
Hello Balaji,

I you prefer not to use the advanced templates, an alternative solution is to find the resource combobox in the advanced form by handling FormCreated as explained in this help topic - http://www.telerik.com/help/aspnet-ajax/scheduler-customizing-advanced-form-formcreated.html ->sroll down to the section on "Change the selected index of a resource combobox so always one option is preselected". Then you can attach to its SelectedIndexChanged event dynamically.

I hope this helps.


All the best,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Scheduler
Asked by
Abdul
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Abdul
Top achievements
Rank 1
roshani
Top achievements
Rank 1
Balaji
Top achievements
Rank 1
Peter
Telerik team
Share this question
or