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

*Urgent* How do open RadWindow From OnAppoinmentClick

6 Answers 72 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Luffy
Top achievements
Rank 1
Luffy asked on 30 Jun 2011, 08:46 PM
I have a urgent question to ask and i have problem doing it.

I have a rescheduler with Appointment on it, when i click on the appointment i want it to open RadWindow to display more information. However, i have no idea how it can be done at the server side. I have tried doing client side but it doesnt appear too.



<script type="text/javascript">
    function openwin() {
       
        var win = window.radopen('EventDetail.aspx', 'Details'); win.center();
     }

</script>

       <telerik:RadWindowManager runat="server" ID="RadWindowManager1">
            <Windows>
                <telerik:RadWindow runat="server" ID="Details" VisibleStatusbar="false" NavigateUrl="EventDetail.aspx"
                    Width="635px" Height="530px" AutoSize="false" Behaviors="Close,Move" ShowContentDuringLoad="false"
                    Modal="true">
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
                                            <telerik:RadScheduler ID="RadScheduler1" runat="server" 
                                               AllowDelete="false" AllowInsert="false"   AllowEdit="False" DataDescriptionField="EventDesc"
                                                DataEndField="EventEndTime" DataKeyField="EventID" OnClientAppointmentClick="openwin()"
                                                DataSourceID="SqlDataSource1" DataStartField="EventStartTime" 
                                                DataSubjectField="EventTitle" DayEndTime="23:59:00"
                                                EditFormDateFormat="d/M/yyyy" EnableDescriptionField="True" Skin="Black" 
                                                
                                                style="z-index: 1; left: 210px; top: 34px; position: absolute; height: 425px; width: 861px" >
                                                <AdvancedForm DateFormat="d/M/yyyy" />
                                            </telerik:RadScheduler>

6 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Jul 2011, 05:17 AM
Hello Sherman,

When you are calling a client side function from a Radcontrol it expects only the function name. You can call the function just by specifying its name. In order to show the window from server side attach OnAppointmentClick and try the following code.
Here is a sample code.
aspx:
<telerik:RadScheduler ID="RadScheduler1" runat="server" OnClientAppointmentClick="openwin" onappointmentclick="RadScheduler1_AppointmentClick". . . . >

Code for opening window from server side:
C#:
protected void RadScheduler1_AppointmentClick(object sender, SchedulerEventArgs e)
   {
   Details.AutoSize = true;
   Details.VisibleOnPageLoad = true;
   }

Thanks,
Shinu.
0
Luffy
Top achievements
Rank 1
answered on 01 Jul 2011, 07:49 AM
I have tried but it doesnt seems to work
0
Shinu
Top achievements
Rank 2
answered on 01 Jul 2011, 09:18 AM
Hello Sherman,
Here am pasting the full code I tried which worked as expected at my end.
aspx:
<telerik:RadWindowManager runat="server" ID="RadWindowManager1">
      <Windows>
       <telerik:RadWindow runat="server" ID="Details" VisibleStatusbar="false" NavigateUrl="EventDetail.aspx"
                    Width="635px" Height="530px" AutoSize="false" Behaviors="Close,Move" ShowContentDuringLoad="false"
                    Modal="true">
        </telerik:RadWindow>
     </Windows>
</telerik:RadWindowManager>
<telerik:RadScheduler ID="RadScheduler1" runat="server" OnClientAppointmentClick="openWindow"
            OnAppointmentInsert="RadScheduler1_AppointmentInsert">       
</telerik:RadScheduler>

Javascript:
<script type="text/javascript">
    function openWindow()
    {
        alert("hai");
        var win = window.radopen('EventDetail.aspx', 'Details');
        win.center();
    }
</script>

Thanks,
Shinu.
0
Luffy
Top achievements
Rank 1
answered on 01 Jul 2011, 09:30 AM
Thanks! 

It's working fine now! :D
0
Luffy
Top achievements
Rank 1
answered on 01 Jul 2011, 10:35 AM
I have another issue now, when i clicked on Another component RadListBox. The Window will automatically pop up without clicking on the Appointment
0
Luffy
Top achievements
Rank 1
answered on 01 Jul 2011, 12:15 PM
It's okay, i have solve already.
Tags
General Discussions
Asked by
Luffy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Luffy
Top achievements
Rank 1
Share this question
or