Tooltip in customwebcontrol

3 posts, 0 answers
  1. Rolus
    Rolus avatar
    3 posts
    Member since:
    Jul 2006

    Posted 14 May 2008 Link to this post

    Hello,

    I was having a lot of trouble getting the radtooltip to work correctly in a customwebcontrol (source is appended). For IE all is working ok. For Firefox and Opera there is an issue. When I set the alternatetext property of the image the tool tip won't show in both browser. When it's empty it is al working ok. As a workaround i leave the alttext empty although it's against our policies. You know an other solution for this problem?

    Thanks,
    Carol

    1 using System.ComponentModel;  
    2 using System.Web.UI;  
    3 using System.Web.UI.WebControls;  
    4 using ONVZ.DP.Site.Controls;  
    5 using Telerik.Web.UI;  
    6  
    7 namespace ONVZ.DP.Site.controls  
    8 {  
    9     [ToolboxData("<{0}:SmartsiteTooltip runat=\"server\"></{0}:SmartsiteTooltip>")]  
    10     public partial class SmartsiteTooltip : PlaceHolder  
    11     {  
    12         [Category("Behavior")]  
    13         [Description("helpID van de SmartSite helptext (bijv. HLP960_1)")]  
    14         public string HelpID  
    15         {  
    16             get 
    17             {  
    18                 string s = "";  
    19                 if (ViewState["HelpID"] != null)  
    20                     s = ViewState["HelpID"].ToString();  
    21                 return s;  
    22             }  
    23             set 
    24             {  
    25                 ViewState["HelpID"] = value;  
    26             }  
    27         }  
    28  
    29         [Category("Behavior")]  
    30         [Description(@"Als de SmartSite helptext niet gevonden wordt en deze flag staat op true 
    31                     dan wordt de hele tooltip niet getoond. Default false en alleen in release build.")]  
    32         public bool VerbergenIndienLeeg  
    33         {  
    34             get 
    35             {  
    36                 string s = "false";  
    37                 if (ViewState["VerbergenIndienLeeg"] != null)  
    38                     s = ViewState["VerbergenIndienLeeg"].ToString();  
    39                 return bool.Parse(s);  
    40             }  
    41             set 
    42             {  
    43                 ViewState["VerbergenIndienLeeg"] = value;  
    44             }  
    45         }  
    46  
    47         [Category("Appearance")]  
    48         [Description("De alt-tekst van het plaatje. Default waarde is 'Informatie'.")]  
    49         public string AlternatieveTekst  
    50         {  
    51             get 
    52             {  
    53                 string s = "Informatie";  
    54                 if (ViewState["AlternateText"] != null)  
    55                     s = ViewState["AlternateText"].ToString();  
    56                 return s;  
    57             }  
    58             set 
    59             {  
    60                 ViewState["AlternateText"] = value;  
    61             }  
    62         }  
    63  
    64         [Category("Appearance")]  
    65         [Description("Url van het plaatje default wordt er een vraagteken gebruikt")]  
    66         public string AfbeeldingsPad  
    67         {  
    68             get 
    69             {  
    70                 string s = ResolveUrl("~/images/help.gif");  
    71                 if (ViewState["ImageUrl"] != null)  
    72                     s = ViewState["ImageUrl"].ToString();  
    73                 return s;  
    74             }  
    75             set 
    76             {  
    77                 ViewState["ImageUrl"] = value;  
    78             }  
    79         }  
    80  
    81         [Category("Appearance")]  
    82         [Description("Titel van de tooltip. Deze wordt bovenin het venster getoond.")]  
    83         public string VensterTitel  
    84         {  
    85             get 
    86             {  
    87                 string s = "";  
    88                 if (ViewState["VensterTitel"] != null)  
    89                     s = ViewState["VensterTitel"].ToString();  
    90                 return s;  
    91             }  
    92             set 
    93             {  
    94                 ViewState["VensterTitel"] = value;  
    95             }  
    96         }  
    97  
    98         protected override void CreateChildControls()  
    99         {  
    100             Image img = new Image  
    101             {  
    102                 //AlternateText = this.AlternatieveTekst,  
    103                 ImageUrl = this.AfbeeldingsPad,  
    104                 ID = string.Concat(HelpID, "Stt")  
    105             };  
    106             this.Controls.Add(img);  
    107  
    108             RadToolTip rtt = new RadToolTip  
    109             {  
    110                 Animation = ToolTipAnimation.Fade,  
    111                 ShowCallout = false,  
    112                 Skin = "tt441",  
    113                 Height = Unit.Pixel(250),  
    114                 Width = Unit.Pixel(350),  
    115                 OnClientShow = "DotNetIframeResize",  
    116                 RelativeTo = ToolTipRelativeDisplay.Element,  
    117                 Position = ToolTipPosition.BottomCenter,  
    118                 ContentScrolling = ToolTipScrolling.Y,  
    119                 Sticky = true,  
    120                 ManualClose = true,  
    121                 Title = VensterTitel,  
    122                 EnableEmbeddedSkins = false,  
    123                 TargetControlID = img.ID  
    124             };
    125 #if DEBUG  
    126             rtt.Text = string.Format("HelpID: {0}</ br>{1}", HelpID, SmartsiteTextLabel.GetSmartsiteText(HelpID));
    127 #else  
    128             rtt.Text = SmartsiteTextLabel.GetSmartsiteText(HelpID);  
    129             if (VerbergenIndienLeeg && rtt.Text.ToUpper().Contains("TEKST_NIET_GEVONDEN:"))  
    130             {  
    131                 rtt.Visible = false;  
    132             }
    133 #endif  
    134             this.Controls.Add(rtt);  
    135               
    136             base.CreateChildControls();  
    137         }  
    138     }  
    139 }  
    140  
  2. Rolus
    Rolus avatar
    3 posts
    Member since:
    Jul 2006

    Posted 15 May 2008 Link to this post

    Seems I won't get an answer, is it normal, is it a bug questions questons questions....
    Should I make a ticket for it to receive an answer?
  3. Dave Forster
    Dave Forster avatar
    5 posts
    Member since:
    May 2008

    Posted 16 May 2008 Link to this post

    Hi Carol,

    I believe the alttext property is specific to IE and not supported by other "standards based" browsers.  You should use the "Title" attribute which is supported by all and this should cure your problem.

    regards
    Dave
Back to Top