Server side OnTimeSlotClick event?

8 posts, 0 answers
  1. Domamu
    Domamu avatar
    3 posts
    Member since:
    Jul 2006

    Posted 09 Feb 2009 Link to this post

    Hi,
      I noticed there is a client side event called OnClientTimeSlotClick and there are few posts about how to get the time when somebody click on an empty slot on the schedule.  But I really don't want to use client side event.

      Is there a similar event for server side?  I assume it's called OnTimeSlotClick, but I couldn't find it.

    Thanks,
    Dom
  2. Adam Cole
    Adam Cole avatar
    31 posts
    Member since:
    Nov 2004

    Posted 10 Feb 2009 Link to this post

    Hi Dom,
      Have you found out how to get the time when user click on an empty time slot?
  3. Domamu
    Domamu avatar
    3 posts
    Member since:
    Jul 2006

    Posted 11 Feb 2009 Link to this post

    Bump bump..
    Can anyone answer my question?
    I think it's a very simple question.  If not, I can open a ticket.
  4. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 11 Feb 2009 Link to this post

    Hello guys,

    I can confirm that RadScheduler does not expose a TimeSlotClick server event. The OnClientTimeSlotClick though should be sufficient. You can use it in combination with RadAjaxManager and handle the AjaxRequest server event to pass data from the clicked timeslot to the server. The context menu integration example uses a similar concept. I can give you a code sample if you specify what exactly you need to achieve.  


    All the best,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Domamu
    Domamu avatar
    3 posts
    Member since:
    Jul 2006

    Posted 11 Feb 2009 Link to this post

    Hi Peter,
        Thank you for the response.  Actually, I have the code to combine RadAjaxManager and AjaxRequest server event and it works.  I was just curious if there is a easier way to do it.

    Thanks,
    Dom

  6. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 13 Feb 2009 Link to this post

    Hi Dom,

    Your inquiry is quite understandable in light of the lines of code required for the workaround, but there isn't really a simpler way to achieve this.



    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.
  7. Luke
    Luke avatar
    5 posts
    Member since:
    Jan 2011

    Posted 23 Feb 2011 Link to this post

    Hi Peter,

    I have a similar problem as I'm trying to check the appointment availability when a user clicks a timeslot (before they fill out everything in my custom form to realize they have to start over).  I was wondering if you could post the sample code you were talking about that shows how to pass variables to a server side event using the onclienttimeslotclick client side event.

    Thanks,

    Luke
  8. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 24 Feb 2011 Link to this post

    Hi Luke,

    Here is a code sample using the approach from this help topic:

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
          <script type="text/javascript">
              function OnClientTimeSlotClick(sender, args) {
                  $find("<%=RadAjaxManager1.ClientID %>").ajaxRequest(args.get_targetSlot().get_startTime().format("yyyy/MM/dd hh:mm"));
              }
          </script>
      </telerik:RadCodeBlock>
      <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
      </telerik:RadScriptManager>
      <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
          <AjaxSettings>
              <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                  <UpdatedControls>
                      <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                  </UpdatedControls>
              </telerik:AjaxSetting>
          </AjaxSettings>
      </telerik:RadAjaxManager>
      <telerik:RadScheduler runat="server" ID="RadScheduler1" OnClientTimeSlotClick="OnClientTimeSlotClick">
      </telerik:RadScheduler>


    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
       {
           RadScheduler1.ShowInlineInsertForm(DateTime.Parse(e.Argument));
       }


    All the best,
    Peter
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top