OnAjaxUpdate Not working Tooltipmanager , ListView

3 posts, 0 answers
  1. Nattapong
    Nattapong avatar
    6 posts
    Member since:
    Jun 2013

    Posted 02 Jun 2013 Link to this post

    Hi, 

    I'm use tooltipmanager in RadListView follow by demos tooltip load on demand, But OnAjaxUpdate not working when mouseover item in radlistview 

    Follow,

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ListShowAccreditation">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ListShowAccreditation" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
     
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Position="Center"
        RelativeTo="Element" Width="400px" Height="200px" Animation="Resize" HideEvent="LeaveTargetAndToolTip"
        Skin="Default" OnAjaxUpdate="OnAjaxUpdate" OnClientHide="OnClientHide" RenderInPageRoot="true"
        AnimationDuration="200">
    </telerik:RadToolTipManager>
    <asp:Label ID="Label1" runat="server" />
    <telerik:RadListView ID="RadListView1" ItemPlaceholderID="PlaceHolder_ListShowAccredit"
        runat="server" OnSelectedIndexChanged="ListBox_SelectedIndexChanged" DataValueField="AccreditationID"
        AutoPostBack="true">
        <LayoutTemplate>
            <asp:PlaceHolder ID="PlaceHolder_ListShowAccredit" runat="server" />
        </LayoutTemplate>
        <ItemTemplate>
            <asp:Label ID="lblAccreditID" runat="server" Text='<%# Eval("AccreditationID") %>'
                Visible="false" />
            <a>
                <asp:Label ID="lblAccredit" runat="server" Text='<%# Eval("Name") %>' ForeColor="#0083BA"
                    Visible="true" />
                <asp:Label ID="lblComma" Text=", " ForeColor="#0083BA" runat="server" /></a>
        </ItemTemplate>
    </telerik:RadListView>


    In codebehind

    private void UpdateToolTip(string elementID, UpdatePanel panel)
           {
               Control ctrl = Page.LoadControl("AccreditationPopup.ascx");
               panel.ContentTemplateContainer.Controls.Add(ctrl);
               UCAccreditationPopup details = (UCAccreditationPopup)ctrl;
               details.ID = elementID;
           }
     
           protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
           {
               this.UpdateToolTip(args.Value, args.UpdatePanel);
           }
     
           protected void ListBox_SelectedIndexChanged(object sender, EventArgs e)
           {
               this.RadToolTipManager1.TargetControls.Clear();
               ListShowAccreditation.DataBind();
           }


    I'm newbie to use telerik. 
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 07 Jun 2013 Link to this post

    Hello,

    You need to add targets for the tooltip manager in order to have tooltips with load on demand on concrete elements. A similar example can be found in this demo: http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx?product=tooltip. I am also attaching here a small sample that shows the logic with a listview control.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nattapong
    Nattapong avatar
    6 posts
    Member since:
    Jun 2013

    Posted 07 Jun 2013 Link to this post

    Thank you,  

    I was wrong to  e.Item.FinControl("");  

    I can do it
    Control target = e.Item.FindControl("lblAccredit");
                RadToolTipManager1.TargetControls.Add(target.ClientID, (e.Item as RadListViewDataItem).DataItemIndex.ToString(), true);
Back to Top