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

OnAjaxUpdate Not working Tooltipmanager , ListView

2 Answers 46 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Nattapong
Top achievements
Rank 1
Nattapong asked on 03 Jun 2013, 04:13 AM
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 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 07 Jun 2013, 08:52 AM
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.
0
Nattapong
Top achievements
Rank 1
answered on 07 Jun 2013, 09:02 AM
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);
Tags
ToolTip
Asked by
Nattapong
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Nattapong
Top achievements
Rank 1
Share this question
or