Hi Telerik,
I'm trying to update the RadToolTipManager by using an RadAjaxManager. The tooltip works fine on the initial page-request but disappears on the ajax-postback.
To illustrate, I've made the simplest possible example, that is like the scenario I need. May I emphasize that, yes, in this simple example you could make this work another way, but I would have to rebuilt some complicated stuff in the actual environment, to do it another way.
Looking forward to your answer.
Best regards,
Emil Hjordt Jensen
I'm trying to update the RadToolTipManager by using an RadAjaxManager. The tooltip works fine on the initial page-request but disappears on the ajax-postback.
To illustrate, I've made the simplest possible example, that is like the scenario I need. May I emphasize that, yes, in this simple example you could make this work another way, but I would have to rebuilt some complicated stuff in the actual environment, to do it another way.
Code-ahead:
<asp:ScriptManager runat="server" /> |
<asp:Button ID="ReDataBindButton" Text="Re-databind plx" OnClick="ReDataBindButton_Click" runat="server" /> |
<asp:Panel ID="TesterPanel" runat="server"> |
<asp:Repeater ID="TesterRepeater" runat="server" OnItemDataBound="TesterRepeater_ItemDataBound"> |
<ItemTemplate> |
<asp:Label ID="TesterLabel" runat="server" /> |
</ItemTemplate> |
</asp:Repeater> |
</asp:Panel> |
<radA:AjaxLoadingPanel ID="TesterLoadingPanel" runat="server" Height="75px" Width="75px"> |
<asp:Image runat="server" AlternateText="Loading..." ImageUrl="~/RadControls/Ajax/Skins/Default/Loading.gif" /> |
</radA:AjaxLoadingPanel> |
<telerik:RadToolTipManager ID="TesterRadToolTipManager" runat="server" /> |
<radA:RadAjaxManager ID="TesterRadAjaxManager" runat="server"> |
<AjaxSettings> |
<radA:AjaxSetting AjaxControlID="ReDataBindButton"> |
<UpdatedControls> |
<radA:AjaxUpdatedControl ControlID="TesterPanel" LoadingPanelID="TesterLoadingPanel" /> |
<radA:AjaxUpdatedControl ControlID="TesterRadToolTipManager" /> |
</UpdatedControls> |
</radA:AjaxSetting> |
</AjaxSettings> |
</radA:RadAjaxManager> |
Code-behind ;):
protected void Page_Load(object sender, EventArgs e) |
{ |
this.DataBindStuff(); |
} |
private void DataBindStuff() |
{ |
List<string> items = new List<string>(); |
items.Add("item1"); |
items.Add("item2"); |
items.Add("item3"); |
items.Add("item4"); |
items.Add("item5"); |
TesterRepeater.DataSource = items; |
TesterRepeater.DataBind(); |
} |
protected void ReDataBindButton_Click(object sender, EventArgs e) |
{ |
this.DataBindStuff(); |
} |
protected void TesterRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) |
{ |
if (!(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)) |
return; |
Label TesterLabel = (Label)e.Item.FindControl("TesterLabel"); |
TesterLabel.Text = (string)e.Item.DataItem; |
TesterRadToolTipManager.TargetControls.Add(TesterLabel.ClientID, true); |
} |
Looking forward to your answer.
Best regards,
Emil Hjordt Jensen