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

Reading advanced form values

3 Answers 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 27 Jan 2011, 03:48 AM
Hi

I'm working with the scheduler and the advanced insert edit form.

I have the need to customize the Sql DataSource INSERT statement attached to my scheduler named RadScheduler1

First up I located the RadScheduler1_AppointmentInsert event.

In there I am able to set the data source InsertCommand like this.

SqlDataSource1.InsertCommand = @"INSERT INTO [Activity] (

etc..

And then execute

SqlDataSource1.Insert();

So far so good.

However, I found that I now need to manually read all of the Advanced Form input boxes to satisfy the insert statement. That is, they are not longer collected for me. A hassle but not a show stopper.

Problem is how to I read the inputs on the advanced form from the code behind?

For example. Using Firebug, I could see that the Start Date text box is named...

RadScheduler1_Form_StartDate_dateInput_text

This object does not exist in the code behind.  How do I read it?

3 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 27 Jan 2011, 12:34 PM
Hello Brad,

The best way to check the ID-s of the Advanced Form controls is to find them in the AdvancedForm.ascx file of this demo. As to find them in code-behind - please subscribe to the OnFormCreated server-side event and use similar code in the handler:

protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)   
{   
    if ((e.Container.Mode == SchedulerFormMode.AdvancedEdit) || (e.Container.Mode == SchedulerFormMode.AdvancedInsert))   
    {   
        //Find the Subject textbox
        RadTextBox subjectTextbox = (RadTextBox)e.Container.FindControl("Subject");   
    }
}

You can use this KB article for further information.

Greetings,
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
Brad
Top achievements
Rank 1
answered on 28 Jan 2011, 01:57 AM
Veronica

Thanks for your reply, but I'm afraid I don't get it.

You mention 'subscribing to the OnFormCreated event'.

Where is this event found? If i highlight the scheduler in Design view, and then look at Properties and hit the Event button at the top, OnFormCreated is not there.

Next, is OnFormCreated the best place to read the form values after the user hits the Save button? I have been trying to do that in

protected void RadScheduler1_AppointmentInsert(object sender, AppointmentInsertEventArgs e)

as that seemed logical.

Does AppointmentInsertEventArgs e hold the values I am after?

Brad
0
Peter
Telerik team
answered on 28 Jan 2011, 10:57 AM
Hi Brad,

Yes, you can use AppointmentInsert/Delete/Update and use the appointment object to update your data base (e.Appointment or e.ModifiedAppointment for Update). You can see this demo as reference - http://demos.telerik.com/aspnet-ajax/scheduler/examples/bindtolist/defaultcs.aspx


Regards,
Peter
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.
Tags
General Discussions
Asked by
Brad
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Brad
Top achievements
Rank 1
Peter
Telerik team
Share this question
or