I have a radgrid. A couple of columns require tooltip. I am using web service to load data into my tooltip instead of pre-loading them during grid load.
Here's my grid and radtooltip manager.
On the codebehind I'm settng the tooltip manager info.
Now, I'm setting the tooltip info in the grid itemcreated method
Here's my webservice method if you think it helps you:
So far so fine. The hlProduct element now shows tooltip. Now, I want the hlPrice element to show tooltip as well. Problem is I can't have another tooltipmanager in the page. I don't know if it is possible to create a new method for the new element.
Can somebody help me with it.
Thanks.
Here's my grid and radtooltip manager.
<telrik:RadGrid ID="rg" runat="server" ....> |
<MasterTableview DataSourceId="odsProducts"> |
<Columns> |
<telerik:GridTemplateColumn HeaderText="Product"> |
<ItemTemplate> |
<asp:HyperLink ID="hlProduct" runat="server" /> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn HeaderText="Price"> |
<ItemTemplate> |
<asp:HyperLink ID="hlPrice" runat="server" /> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
</Columns> |
</MasterTableView |
</telerik:RadGrid> |
<telerik:RadToolTipManager ID="rttManager" runat="server" Position="BottomCenter" RelativeTo="Element" Animation="Fade" /> |
On the codebehind I'm settng the tooltip manager info.
rttManager.WebServiceSettings.Path = "~/WebServices/AppWebService.asmx"; |
rttManager.WebServiceSettings.Method = "GetProductToolTips"; |
rttManager.HideEvent = ToolTipHideEvent.LeaveTargetAndToolTip; |
Now, I'm setting the tooltip info in the grid itemcreated method
rttManager.TargetControls.Add(hlProducts.ClientID, productId.ToString(), true); |
Here's my webservice method if you think it helps you:
[WebMethod] |
public string GetProductToolTips (object context) |
{ |
IDictionary<string, object> contextDictionary = (IDictionary<string, object>)context; |
string productId = ((string)contextDictionary["Value"]); |
if (String.IsNullOrEmpty(productId)) |
return String.Empty; |
else |
return RenderViewManager.RenderView("~/Products/UserControls/ProductToolTip.ascx"); |
} |
So far so fine. The hlProduct element now shows tooltip. Now, I want the hlPrice element to show tooltip as well. Problem is I can't have another tooltipmanager in the page. I don't know if it is possible to create a new method for the new element.
Can somebody help me with it.
Thanks.