How to show RadToolTip on Right click in An Appointment

2 posts, 0 answers
  1. Ahmed
    Ahmed avatar
    55 posts
    Member since:
    Oct 2012

    Posted 05 Sep 2012 Link to this post

    How can i show RadTooltip Control when i right click on An Appointment and i want to put rad GridView in that tooltip
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 Sep 2012 Link to this post

    Hi Ahmed,

    Try the following code snippet to achieve your scenario.

    ASPX:
    <telerik:RadScheduler ID="RadScheduler1" runat="server" OnClientAppointmentContextMenu="OnClientAppointmentContextMenu" ........>
    </telerik:RadScheduler>
    <telerik:RadToolTip ID="RadToolTip1" runat="server" Position="BottomCenter">
        <div id="contentContainer">
           <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="true" DataSourceID="SqlDataSource1">
           </telerik:RadGrid>
        </div>
    </telerik:RadToolTip>

    JS:
    <script type="text/javascript">
        function OnClientAppointmentContextMenu(sender, args) {
            var apt = args.get_appointment();
            showTooltip(apt);
        }
        function showTooltip(apt) {
            var tooltip = $find('<%=RadToolTip1.ClientID %>');
            tooltip.set_targetControl(apt.get_element());
            debugger;
            tooltip.set_text($get("contentContainer").innerHTML);
            setTimeout(function () {
                tooltip.show();
            }, 20);
        }               
    </script>

    Hope this helps.

    Regards,
    Princy.
Back to Top