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
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
using System.ComponentModel; | |
using System.Web.UI; | |
using System.Web.UI.WebControls; | |
using ONVZ.DP.Site.Controls; | |
using Telerik.Web.UI; | |
namespace ONVZ.DP.Site.controls | |
{ | |
[ToolboxData("<{0}:SmartsiteTooltip runat=\"server\"></{0}:SmartsiteTooltip>")] | |
public partial class SmartsiteTooltip : PlaceHolder | |
{ | |
[Category("Behavior")] | |
[Description("helpID van de SmartSite helptext (bijv. HLP960_1)")] | |
public string HelpID | |
{ | |
get | |
{ | |
string s = ""; | |
if (ViewState["HelpID"] != null) | |
s = ViewState["HelpID"].ToString(); | |
return s; | |
} | |
set | |
{ | |
ViewState["HelpID"] = value; | |
} | |
} | |
[Category("Behavior")] | |
[Description(@"Als de SmartSite helptext niet gevonden wordt en deze flag staat op true | |
dan wordt de hele tooltip niet getoond. Default false en alleen in release build.")] | |
public bool VerbergenIndienLeeg | |
{ | |
get | |
{ | |
string s = "false"; | |
if (ViewState["VerbergenIndienLeeg"] != null) | |
s = ViewState["VerbergenIndienLeeg"].ToString(); | |
return bool.Parse(s); | |
} | |
set | |
{ | |
ViewState["VerbergenIndienLeeg"] = value; | |
} | |
} | |
[Category("Appearance")] | |
[Description("De alt-tekst van het plaatje. Default waarde is 'Informatie'.")] | |
public string AlternatieveTekst | |
{ | |
get | |
{ | |
string s = "Informatie"; | |
if (ViewState["AlternateText"] != null) | |
s = ViewState["AlternateText"].ToString(); | |
return s; | |
} | |
set | |
{ | |
ViewState["AlternateText"] = value; | |
} | |
} | |
[Category("Appearance")] | |
[Description("Url van het plaatje default wordt er een vraagteken gebruikt")] | |
public string AfbeeldingsPad | |
{ | |
get | |
{ | |
string s = ResolveUrl("~/images/help.gif"); | |
if (ViewState["ImageUrl"] != null) | |
s = ViewState["ImageUrl"].ToString(); | |
return s; | |
} | |
set | |
{ | |
ViewState["ImageUrl"] = value; | |
} | |
} | |
[Category("Appearance")] | |
[Description("Titel van de tooltip. Deze wordt bovenin het venster getoond.")] | |
public string VensterTitel | |
{ | |
get | |
{ | |
string s = ""; | |
if (ViewState["VensterTitel"] != null) | |
s = ViewState["VensterTitel"].ToString(); | |
return s; | |
} | |
set | |
{ | |
ViewState["VensterTitel"] = value; | |
} | |
} | |
protected override void CreateChildControls() | |
{ | |
Image img = new Image | |
{ | |
//AlternateText = this.AlternatieveTekst, | |
ImageUrl = this.AfbeeldingsPad, | |
ID = string.Concat(HelpID, "Stt") | |
}; | |
this.Controls.Add(img); | |
RadToolTip rtt = new RadToolTip | |
{ | |
Animation = ToolTipAnimation.Fade, | |
ShowCallout = false, | |
Skin = "tt441", | |
Height = Unit.Pixel(250), | |
Width = Unit.Pixel(350), | |
OnClientShow = "DotNetIframeResize", | |
RelativeTo = ToolTipRelativeDisplay.Element, | |
Position = ToolTipPosition.BottomCenter, | |
ContentScrolling = ToolTipScrolling.Y, | |
Sticky = true, | |
ManualClose = true, | |
Title = VensterTitel, | |
EnableEmbeddedSkins = false, | |
TargetControlID = img.ID | |
}; | |
#if DEBUG | |
rtt.Text = string.Format("HelpID: {0}</ br>{1}", HelpID, SmartsiteTextLabel.GetSmartsiteText(HelpID)); | |
#else | |
rtt.Text = SmartsiteTextLabel.GetSmartsiteText(HelpID); | |
if (VerbergenIndienLeeg && rtt.Text.ToUpper().Contains("TEKST_NIET_GEVONDEN:")) | |
{ | |
rtt.Visible = false; | |
} | |
#endif | |
this.Controls.Add(rtt); | |
base.CreateChildControls(); | |
} | |
} | |
} | |