Hi.
I'm getting this error using a RadToolTipManager, related to a control (RadioButton) inside a gridView.
When I click on RadioButton, I want the tooltip to appear. The tooltip refers to a UserControl.
I attach the code, if needed.
Thanks in advance.
Leo
RadToolTip.aspx
RadToolTip.aspx.cs
AttivitaShort.ascx
AttivitaShort.ascx.cs
I'm getting this error using a RadToolTipManager, related to a control (RadioButton) inside a gridView.
When I click on RadioButton, I want the tooltip to appear. The tooltip refers to a UserControl.
I attach the code, if needed.
Thanks in advance.
Leo
RadToolTip.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="radtooltip.aspx.cs" Inherits="WebApplication1.radtooltip" %><%@ Register Assembly="Telerik.Web.UI, Version=2010.2.713.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <asp:ScriptManager ID="MasterScriptManager" runat="server" AsyncPostBackTimeout="300" ScriptMode="Release"> </asp:ScriptManager> <telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Position="Center" RelativeTo="Element" Width="400px" Height="200px" Animation="Resize" Skin="Default" OnAjaxUpdate="OnAjaxUpdate" ShowEvent="OnClick" EnableShadow="true" RenderInPageRoot="true" ShowDelay="0"> </telerik:RadToolTipManager> <asp:GridView ID="AttivitaGv" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" OnRowDataBound="AttivitaGV_RowDataBound" Width="950px" ViewStateMode="Enabled" CellPadding="3"> <columns> <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="60px"> <ItemTemplate> <asp:RadioButton ID="rbPianificata" runat="server" GroupName="StatoAttivita" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="60px"> <ItemTemplate> <asp:RadioButton ID="rbEffettuata" runat="server" GroupName="StatoAttivita" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="60px"> <ItemTemplate> <asp:RadioButton ID="rbAnnullata" runat="server" GroupName="StatoAttivita" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="60px"> <ItemTemplate> <asp:RadioButton ID="rbRipianificata" runat="server" GroupName="StatoAttivita" /> </ItemTemplate> </asp:TemplateField> </columns> <pagersettings mode="NumericFirstLast" /> <alternatingrowstyle cssclass="GridAlternating" /> <editrowstyle cssclass="GridEdit" /> <footerstyle cssclass="GridFooter" /> <headerstyle cssclass="GridHeader" /> <pagerstyle cssclass="GridPager" /> <rowstyle cssclass="GridRow" /> <selectedrowstyle cssclass="GridSelectedRow" /> <sortedascendingcellstyle cssclass="GridSortedCells" /> <sortedascendingheaderstyle cssclass="GridSortedHeader" /> <sorteddescendingcellstyle cssclass="GridSortedCells" /> <sorteddescendingheaderstyle cssclass="GridSortedHeader" /> </asp:GridView></asp:Content>RadToolTip.aspx.cs
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Telerik.Web.UI;namespace WebApplication1{ public partial class radtooltip : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { List<Item> items = new List<Item>(); items.Add(new Item() { IdCliente = 1, Email = "Mark" }); items.Add(new Item() { IdCliente = 2, Email = "Jon" }); items.Add(new Item() { IdCliente = 3, Email = "Frank" }); items.Add(new Item() { IdCliente = 4, Email = "Mark" }); AttivitaGv.DataSource = items; AttivitaGv.DataBind(); } protected void AttivitaGV_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { this.RadToolTipManager1.TargetControls.Add(((RadioButton)e.Row.FindControl("rbPianificata")).ClientID, "123", true); } } catch (Exception ex) { throw new Exception(ex.Message, ex); } } protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args) { this.UpdateToolTip(args.Value, args.UpdatePanel); } private void UpdateToolTip(string elementID, UpdatePanel panel) { Control ctrl = Page.LoadControl("AttivitaShort.ascx"); panel.ContentTemplateContainer.Controls.Add(ctrl); AttivitaShort details = (AttivitaShort)ctrl; details.ConfigureView(int.Parse(elementID)); } public class Item { private int id; public int IdCliente { get { return id; } set { id = value; } } private string name; public string Email { get { return name; } set { name = value; } } } }}AttivitaShort.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AttivitaShort.ascx.cs" Inherits="WebApplication1.AttivitaShort" %><asp:Label ID="lbl1" runat="server"></asp:Label>AttivitaShort.ascx.cs
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace WebApplication1{ public partial class AttivitaShort : System.Web.UI.UserControl { protected void Page_Load(object sender, EventArgs e) { } public void ConfigureView(int IdCliente) { lbl1.Text = IdCliente.ToString(); } }}