Dynamically creating time slot context menu

2 posts, 0 answers
  1. Chip Meyer
    Chip Meyer avatar
    5 posts
    Member since:
    Oct 2005

    Posted 03 Feb 2010 Link to this post

    Hi, what I am trying to do is create a time slot context menu based upon the selected value of a radcombobox. What I see happening is that the scheduler is bound once but never server-bound again unless I change the selected date or otherwise do some action on the scheduler.

    I have tried to fire rebind() and select a date but the binding (whether inside _databound, _init) does not fire. 

    functionschedule.set_selectedDate("2/3/2010"); //rs.get_selectedDate()); 

    Am I going to need to build the context menu on the client? Does client "rebind()" require a web services datasource?

    Thanks, Chip
  2. T. Tsonev
    T. Tsonev avatar
    2794 posts

    Posted 09 Feb 2010 Link to this post


    I can confirm that rebind() will only work in Web Service mode for the moment. We'll update it to work for server-side binding as well in the future. The easiest way to force an update now is to use RadAjaxManager:

    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
    <script runat="server">
        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
            if (e.Argument == "Refresh")
    <%-- The wrapper server div is a workaround for
         'The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).' --%>
    <div runat="server">
        <script type="text/javascript">
            function refreshScheduler()
                var ajaxManager = $find('<%= RadAjaxManager1.ClientID %>');

    Well, that's kind of verbose.

    Building the menu on the client sounds like the better option in this case. You can do so in the OnClientTimeSlotContextMenu event as in this example (it demonstrates the similar OnClientAppointmentContextMenu event):


    I hope this helps.

    Tsvetomir Tsonev
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
Back to Top