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

Dynamatically create the rad schedular

3 Answers 73 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
vairam
Top achievements
Rank 1
vairam asked on 10 Jun 2009, 09:54 AM
Hi

I want to dynamatically create the rad schedular with appointment template.
How can i do this?

Radschedular RadScheduler1=new radschedular();

DataTable

 

dt = new DataTable();

 

 

DataColumn dcol=new DataColumn("FieldID",typeof(Int32));

 

dt.Columns.Add(dcol);

dcol =

new DataColumn("Subject");

 

dt.Columns.Add(dcol);

dcol =

new DataColumn("StartTime");

 

dt.Columns.Add(dcol);

dcol =

new DataColumn("EndTime");

 

dt.Columns.Add(dcol);

 

DataRow drow = dt.NewRow();

 

drow[

"FieldID"]=1;

 

drow[

"Subject"]="Test";

 

drow[

"StartTime"] = "05-01-2009 9AM";

 

drow[

"EndTime"] = "05-03-2009 11AM";

 

dt.Rows.Add(drow);

RadScheduler1.DataSource = dt;

RadScheduler1.DataKeyField =

"FieldID";

 

RadScheduler1.DataSubjectField =

"Subject";

 

RadScheduler1.DataStartField =

"StartTime";

 

RadScheduler1.DataEndField =

"EndTime";

 

RadScheduler1.DataBind();

panel1.Controls.Add(RadScheduler1);

I want to give export option for each appointment.
So i want to give a image right hand side of appointment when the user click on the export image it will export to icalender.
i want to duplicate this link below, but my control is dynamic control.
http://demos.telerik.com/aspnet-ajax/scheduler/examples/export/defaultcs.aspx
how can i acheive this functionality

Regards
Vairamuthu


Regards
Vairam

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 10 Jun 2009, 02:19 PM
Hi vairam,

The following kb article will help you achieve your goal:
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/creating-and-adding-an-appointment-template-dynamically-and-accessing-the-appointment-object-in-the-template-class.aspx


Kind 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.
0
vairam
Top achievements
Rank 1
answered on 10 Jun 2009, 03:10 PM
Hi

The given sample the drag and drop the control in aspx page

But in my case there is nothing in aspx page.Every thing in code behind page only

 

<telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="End" DataKeyField="ID"

 

 

DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID"

 

 

DataSourceID="AccessDataSource1" DataStartField="Start"

 

 

DataSubjectField="Subject"

 

 

onnavigationcomplete="RadScheduler1_NavigationComplete">

 

 

<AppointmentTemplate>

 

(

<asp:Literal ID="AppointmentStartTime" runat="server" Text='<%# Eval("Start", "{0:t}") %>'></asp:Literal>

 

-

 

<asp:Literal ID="AppoitmentEndTime" runat="server" Text='<%# Eval("End", "{0:t}") %>'></asp:Literal>)

 

 

<asp:Literal ID="AppointmentSubject" runat="server" Text='<%# Eval("Subject") %>'></asp:Literal>

 

 

</AppointmentTemplate>

 

 

</telerik:RadScheduler>

Regards
Vairam

 

0
Peter
Telerik team
answered on 10 Jun 2009, 03:20 PM
Hello vairam,

The kb article also shows how to dynamically create and add appointement template. Simply ignore the aspx definition of the template and instead of NavigationComplete:

protected void RadScheduler1_NavigationComplete(object sender, Telerik.Web.UI.SchedulerNavigationCompleteEventArgs e)
{
if (e.Command != SchedulerNavigationCommand.SwitchToMonthView)
{
RadScheduler1.AppointmentTemplate = new AppTemplate();
}
}

use page load instead to to execute:
RadScheduler1.AppointmentTemplate = new AppTemplate();


Greetings,
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
vairam
Top achievements
Rank 1
Answers by
Peter
Telerik team
vairam
Top achievements
Rank 1
Share this question
or