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

How to control RadScheduler_AppointmentCreated' event of radScheduler

7 Answers 88 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Hrushikesh Mokashi
Top achievements
Rank 1
Hrushikesh Mokashi asked on 17 Oct 2008, 05:52 AM
Hi All

I am using RadTabstrip,RadScheduler

In my application , I added 4 tab  as follows

1>Tab1 Contain control
 RadGrid
2>Tab2 Contain  control
 Radscheduler
3>Tab3 Contain control
RadGrid
4>Tab4
 RadGrid

For RadScheduler i added  event as 
RadScheduler_Databinding
and RadScheduler_AppointmentCreated

Issues

When i go from Tab2  to any other tab it work fine
But when i go from Tab3 to Tab4 or
 From Tab4 to Tab3 or
 from Tab3/Tab4 to Tab1 it execute the event
'RadScheduler_AppointmentCreated'

How can i control the event RadScheduler_AppointmentCreated' to call only when Tab2 is click.

Thanks


 

7 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 20 Oct 2008, 08:37 AM
Hello Hrushikesh,

What is the exact setup that you have? We tried the following code, but it worked as expected - the AppointmentCreated event fires only once.

<asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager> 
    <telerik:RadTabStrip ID="RadTabStrip1" MultiPageID="RadMultiPage1" runat="server">  
        <Tabs> 
            <telerik:RadTab runat="server" Text="Root RadTab1">  
            </telerik:RadTab> 
            <telerik:RadTab runat="server" Text="Root RadTab2">  
            </telerik:RadTab> 
            <telerik:RadTab runat="server" Text="Root RadTab3">  
            </telerik:RadTab> 
            <telerik:RadTab runat="server" Text="Root RadTab4">  
            </telerik:RadTab> 
        </Tabs> 
    </telerik:RadTabStrip> 
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server">  
        <telerik:RadPageView ID="RadPageView1" runat="server">  
            RadPageView1</telerik:RadPageView> 
        <telerik:RadPageView ID="RadPageView2" runat="server">  
            RadPageView2  
            <br /> 
            <telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="End" DataKeyField="ID" 
                DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" 
                DataSourceID="AccessDataSource1" DataStartField="Start" DataSubjectField="Subject" 
                OnAppointmentCreated="RadScheduler1_AppointmentCreated">  
            </telerik:RadScheduler> 
        </telerik:RadPageView> 
        <telerik:RadPageView ID="RadPageView3" runat="server">  
            RadPageView3</telerik:RadPageView> 
        <telerik:RadPageView ID="RadPageView4" runat="server">  
            RadPageView4</telerik:RadPageView> 
    </telerik:RadMultiPage> 


Best wishes,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Hrushikesh Mokashi
Top achievements
Rank 1
answered on 20 Oct 2008, 11:30 AM
Hi ,
I am giving code ,please check it.
My problem is not solve yet.

<asp:ScriptManager ID="ScriptManager1" runat="server"> 
 
    </asp:ScriptManager>
 
    <telerik:RadTabStrip ID="RadTabStrip1" MultiPageID="RadMultiPage1" runat="server"> 
 
        <Tabs>
 
            <telerik:RadTab runat="server" Text="Root RadTab1"> 
 
            </telerik:RadTab>
 
            <telerik:RadTab runat="server" Text="Root RadTab2"> 
 
            </telerik:RadTab>
 
            <telerik:RadTab runat="server" Text="Root RadTab3"> 
 
            </telerik:RadTab>
 
            <telerik:RadTab runat="server" Text="Root RadTab4"> 
 
            </telerik:RadTab>
 
        </Tabs>
 
    </telerik:RadTabStrip>
 
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server"                              
 RenderSelectedPageOnly="True"> 
 
        <telerik:RadPageView ID="RadPageView1" runat="server"> 
 
            RadPageView1</telerik:RadPageView>
 
        <telerik:RadPageView ID="RadPageView2" runat="server"> 
 
            RadPageView2 
 
            <br />
 
           <telerik:RadScheduler ID="RadScheduler1" runat="server"
                       DataEndField="STARTTIME" DataKeyField="UNIQUEID"
                       DataStartField="STARTTIME" DataSubjectField="subject" 
                             <timelineview userselectable="false" />
       </telerik:RadScheduler>
                             
 
        </telerik:RadPageView>
 
        <telerik:RadPageView ID="RadPageView3" runat="server"> 
 
            RadPageView3</telerik:RadPageView>
 
        <telerik:RadPageView ID="RadPageView4" runat="server"> 
 
            RadPageView4</telerik:RadPageView>
 
    </telerik:RadMultiPage>

 

//Serverside code to bind calender

Protected Sub RadScheduler1_DataBinding(ByVal sender As Object, ByVal e As EventArgs) Handles radSchedulCalender.DataBinding

        Try
            If IsPostBack Then
              RadScheduler1.DataSource = DatasetValue //DatasetValue return dataset
                RadScheduler1.Rebind()
            End If

        Catch ex As Exception
       
        End Try

    End Sub

Protected Sub RadScheduler1_AppointmentCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.AppointmentCreatedEventArgs) Handles RadScheduler1.AppointmentCreated

//Some code here   
End Sub

Protected Sub RadTabStrip1_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles rtabCallReview.TabClick
  
          If (rtabCallReview.SelectedIndex = 1) Then

              RadScheduler1.DataSource = DatasetValue //DatasetValue return dataset
                RadScheduler1.Rebind()

          end if 

End Sub

 
 

0
Peter
Telerik team
answered on 21 Oct 2008, 12:47 PM
Hello Hrushikesh,

This is expected, because you attach on the TabClick event which causes postback each time you click on a tab.

You don't have to explicitly set the DataSource property of RadScheduler in the TabClick event handler. Setting it in page load is sufficient.  Unless you have some other code in to be handled in TabClick, I suggest you detach from this event which will stop the unnecessary postbacks and the AppointmentCreated event for RadScheduler will fire only once.


All the best,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Hrushikesh Mokashi
Top achievements
Rank 1
answered on 22 Oct 2008, 09:57 AM
Hi All,

Event i remove  the DataSource property of RadScheduler in the TabClick event handler
Still it goes in AppointmentCreated event.

Thanks
0
Peter
Telerik team
answered on 22 Oct 2008, 10:13 AM

Of course - the TabClick event fires and causes postback. The question is do you need to handle the TabClick event for any other reason besides setting RadSchduler's datasource? If not, then detach from this event and let RadTabstrip not cause postback on tab click as in this example.


Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Hrushikesh Mokashi
Top achievements
Rank 1
answered on 22 Oct 2008, 10:41 AM
Hi,

I need tabclick event for other purpose.

Thanks
0
Peter
Telerik team
answered on 22 Oct 2008, 01:30 PM

In this case, the AppointmentCreated event cannot be avoided.


Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
Hrushikesh Mokashi
Top achievements
Rank 1
Answers by
Peter
Telerik team
Hrushikesh Mokashi
Top achievements
Rank 1
Share this question
or