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

How To Open RadWindow When Our Scheduler is in Update Panel

1 Answer 83 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Chandan Kumar
Top achievements
Rank 1
Chandan Kumar asked on 04 May 2010, 09:04 AM
Hello Sir,

How can Open RadWindow When Our Scheduler is in Update Panel.
Schenerio is,
my Scheduler is inside the update panel. and in scheduler i have context menu and i  fired server side code on click of context menu and open rad window.

its work perfectly when scheduler is out side of update panel but when scheduler is in side update panel then its not working.

Aspx Code is below:-

 

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

 

 

<ContentTemplate>

 


<

 

telerik:RadScheduler AllowInsert="false" HoursPanelTimeFormat="hh:mm tt" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"

 

 

OnAppointmentCreated="RadScheduler1_AppointmentCreated" runat="server" ID="RadScheduler1"

 

 

Skin="Office2007" Height="545px" CustomAttributeNames="StatusId" Width="690px"

 

 

ShowFooter="false" SelectedDate="2010-03-18" DayStartTime="07:00:00" DayEndTime="21:00:00"

 

 

FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" EnableDescriptionField="true"

 

 

ShowNavigationPane="false" OnAppointmentDelete="RadScheduler1_AppointmentDelete"

 

 

DataSubjectField="1" DataStartField="1" DataEndField="1" ShowAllDayRow="false"

 

 

AllowEdit="false" DataKeyField="" DataDescriptionField="Description" OnTimeSlotContextMenuItemClicked="RadScheduler1_TimeSlotContextMenuItemClicked"

 

 

AllowDelete="false" OnAppointmentContextMenuItemClicked="RadScheduler1_AppointmentContextMenuItemClicked"

 

 

OnNavigationCommand="RadScheduler1_NavigationCommand" OnTimeSlotCreated="RadScheduler1_TimeSlotCreated">

 

 

<AppointmentContextMenuSettings EnableDefault="false" />

 

 

<TimelineView UserSelectable="false" />

 

 

<AppointmentTemplate>

 

<%

# Eval("Subject")%>

 

 

<br />

 

 

<asp:Label runat="server" ID="Teacher" />

 

 

<br />

 

 

<asp:Label runat="server" ID="Students" />

 

 

</AppointmentTemplate>

 

 

 

<AppointmentContextMenus>

 

 

 

<telerik:RadSchedulerContextMenu runat="server" DataTextField="Status" DataValueField="StatusId"

 

 

ID="SchedulerAppointmentContextMenu" AppendDataBoundItems="true">

 

 

 

<Items>

 

 

 

<telerik:RadMenuItem Text="Copy" Value="Copy" />

 

 

<telerik:RadMenuItem IsSeparator="True" />

 

 

<telerik:RadMenuItem Text="Edit" Value="Edit" />

 

 

<telerik:RadMenuItem IsSeparator="True" />

 

 

</Items>

 

 

</telerik:RadSchedulerContextMenu>

 

 

</AppointmentContextMenus>

 

 

<TimeSlotContextMenus>

 

 

<telerik:RadSchedulerContextMenu runat="server" ID="SchedulerTimeSlotContextMenu">

 

 

<Items>

 

 

<telerik:RadMenuItem Text="New Appointment" Value="New" />

 

 

<telerik:RadMenuItem IsSeparator="true" />

 

 

<telerik:RadMenuItem Text="Paste" Value="Paste" />

 

 

</Items>

 

 

</telerik:RadSchedulerContextMenu>

 

 

</TimeSlotContextMenus>

 

 

<TimeSlotContextMenuSettings EnableDefault="False" />

 

 

</telerik:RadScheduler>

 

</

 

ContentTemplate>

 

 

 

 

 

<Triggers>

 

 

 

 

 

</Triggers>

 

 

 

 

 

</asp:UpdatePanel>

 

 

 



CS Page Code is Below.:-

 

protected

 

void RadScheduler1_TimeSlotContextMenuItemClicked(object sender, TimeSlotContextMenuItemClickedEventArgs e)

 

{

 

if (e.MenuItem.Value == "New")

 

{

 

//RadWindowManager1.Windows[0].Op

 

 

 

 

 

//Alert.Show("Chandan Kumar");

 

 

 

 

 

RadWindowManager windowManager = new RadWindowManager();

 

 

RadWindow widnow1 = new RadWindow();

 

 

// Set the window properties

 

 

 

 

 

//e.TimeSlot.Duration.

 

 

 

 

widnow1.NavigateUrl =

"~/Appointment/AppointmentDetails.aspx?FacilityId=" + ddlFacility.SelectedValue + "&StTime=" + e.TimeSlot.Start.Hour.ToString() + "&EndTime=" + RadScheduler1.DayEndTime.Hours.ToString() + "&appDate=" + RadScheduler1.SelectedDate.Date.ToString("dd/MM/yyyy") + "&appid=0&doctorId=" + ddlDoctor.SelectedValue + "&TimeInterval=" + RadScheduler1.MinutesPerRow.ToString() + "&FromTimeHour=" + e.TimeSlot.Start.Hour.ToString() + "&FromTimeMin=" + e.TimeSlot.Start.Minute.ToString() + "&Provider=" + ddlDoctor.SelectedItem.Text; ;

 

widnow1.Height = 500;

widnow1.Width = 700;

widnow1.Top = 40;

widnow1.Left = 100;

widnow1.ID =

"RadWindow1";

 

widnow1.OnClientClose =

"OnClientClose";

 

widnow1.VisibleOnPageLoad =

true; // Set this property to True for showing window from code

 

 

 

 

widnow1.Modal =

true;

 

widnow1.VisibleStatusbar =

false;

 

widnow1.Behavior =

WindowBehaviors.Close | WindowBehaviors.Move;

 

windowManager.Windows.Add(widnow1);

 

 

this.Form.Controls.Add(widnow1);

 

}

 

else if (e.MenuItem.Value == "Paste")

 

{

 

if (Convert.ToString(ViewState["CopyAppId"]) != "")

 

{

DAL.

DAL dl = new DAL.DAL(DAL.DAL.DBType.SqlServer, sConString);

 

 

Hashtable hshtableout = new Hashtable();

 

 

Hashtable hshtablein = new Hashtable();

 

hshtablein.Add(

"inyHospitalLocationId", Session["HospitalLocationID"]);

 

hshtablein.Add(

"intCopyAppointmentID", Convert.ToInt64(ViewState["CopyAppId"]));

 

hshtablein.Add(

"chrAppFromTime", e.TimeSlot.Start.Hour.ToString()+ ":" + e.TimeSlot.Start.Minute.ToString() );

 

hshtablein.Add(

"chrAppointmentDate", RadScheduler1.SelectedDate.ToString("dd/MM/yyyy"));

 

hshtablein.Add(

"intDoctorId", ddlDoctor.SelectedValue);

 

hshtablein.Add(

"intEncodedBy", Session["UserID"].ToString());

 

hshtableout.Add(

"intAppointmentNo", SqlDbType.Int);

 

hshtableout.Add(

"chvErrorStatus", SqlDbType.VarChar);

 

hshtableout = dl.getOutputParametersValues(

CommandType.StoredProcedure, "UspCopyDoctorAppointment", hshtablein, hshtableout);

 

 

//Cache.Remove("copyappointmentId");

 

 

 

 

 

//Alert.ShowAjaxMsg("Appointment Updated - " + hshtableout["intAppointmentNo"].ToString(), Page);

 

 

 

 

btnRefresh_OnClick(sender, e);

}

}

 

}

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 06 May 2010, 09:42 AM
Hi Chandan,

Because you create the RadWindowManager dynamically, it is not within the UpdatePanel. I suggest  you define RadWindowManager declaratively in the aspx code within the UpdatePanel.


Best wishes,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Scheduler
Asked by
Chandan Kumar
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or