I've the following DataList:
And want to show a tooltip on each Image (imgButton):
In my code-behind I try to add each Images to RadToolTipManager's TargetCollections:
But the Tooltip is only displayed for the first Image....
2nd question: in my LinkHoveringAuthor.GetHoveringText method I try retrieve the userName:
It works, but backslashes are omitted... :-|
For example, here:
if value="dom\user", in the webmethod, the "name" variable equals to "domuser"...
<asp:DataList ID="dataListPhoto" runat="server" RepeatColumns="7" RepeatDirection="Horizontal" OnItemDataBound="dataListPhoto_ItemDataBound"> <ItemTemplate> <asp:Image ID="imgButton" runat="server" ImageUrl='<%# Eval("ImageUrl") %>' Width="32" Height="32" userName='<%# Eval("User") %>' /> </ItemTemplate> </asp:DataList>And want to show a tooltip on each Image (imgButton):
<telerik:RadToolTipManager ID="ttm" Height="200px" Width="350px" HideEvent="LeaveTargetAndToolTip" RelativeTo="Element" Position="TopCenter" runat="server" Skin="Telerik" EnableShadow="true" Animation="Fade" ShowDelay="1000"> <WebServiceSettings Method="GetHoveringText" Path="LinkHoveringAuthor.asmx" /> </telerik:RadToolTipManager>In my code-behind I try to add each Images to RadToolTipManager's TargetCollections:
protected void dataListPhoto_ItemDataBound(object sender, DataListItemEventArgs e) { Image c = (Image) e.Item.FindControl("imgButton"); string value = c.Attributes["userName"]; ttm.TargetControls.Add(c.UniqueID, value, false); }But the Tooltip is only displayed for the first Image....
2nd question: in my LinkHoveringAuthor.GetHoveringText method I try retrieve the userName:
var contextDictionary = (IDictionary<string, object>)context; if (contextDictionary["Value"] != null) { string name = contextDictionary["Value"].ToString();
...It works, but backslashes are omitted... :-|
For example, here:
ttm.TargetControls.Add(c.UniqueID, value, false);