Hi,
I am upgrading 2008 Q3 version of telerik control to 2011 Q3 version in my project in .NET 4.0. To localize/customize the HyperLinkManager of the editor, The LinkManager.ascx file (without .cs file) of the Telerik was customized.
We do have that file under RadControls\Editor\Dialogs folder. It used to work fine until we upgraded. Now, when we click the hyperlink manager icon on the editor it throws the below exception. Is there any workaround for this?
[NullReferenceException: Object reference not set to an instance of an object.]
Telerik.Web.UI.Dialogs.UserControlResources.GetLocalizationScript() +995
Telerik.Web.UI.Dialogs.UserControlResources.OnPreRender(EventArgs e) +46
System.Web.UI.Control.PreRenderRecursiveInternal() +103
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint
8 Answers, 1 is accepted
It is a requirement to use external files taken from the same installation as the Telerik.Web.UI.dll assembly.
The LinkManager of RadEditor is modified and enhanced multiple times from 2008 till now and your version of the LinkManager.ascx file is not compatible with the latest version of RadEditor. You should get the LinkManager.ascx file from the EditorDialogs folder from the 2011 Q3 installation and customize it from scratch. This is the only way to fix the error.
Best regards,
Rumen
the Telerik team
Is there any easy way to hide some of the controls in the HyperLink Manager and also localize all the texts in the HyperLink Manager with out having a copy of the LinkMnager.ascx file with our modificaiton. That way we dont have to customize the ascx file from the scratch everytime we upgrade.
Thanks in Advance!
1. I used to have the below javascript to set the localized string
window.onload = function() {
//BUG FIX
//this method will localize the tabs on the hyperlink manager
//this came from the old linkmanager but since the codebehind sets these values,
//we can't simply set them in markup
var tabStrip = document.getElementById("LinkManagerTab");
var hyperlinkText = document.getElementById("hiddenHyperlinkText").value;
var anchorText = document.getElementById("hiddenAnchorText").value;
var emailText = document.getElementById("hiddenEmailText").value;
tabStrip.innerHTML = tabStrip.innerHTML.replace(">Hyperlink", ">" + hyperlinkText);
tabStrip.innerHTML = tabStrip.innerHTML.replace(">Anchor", ">" + anchorText);
tabStrip.innerHTML = tabStrip.innerHTML.replace(">E-mail", ">" + emailText);
But now with 2011 version of telerik, the above javascipt sets the correct text but when changing the tabs it throws an null exception internally in the telerik javascript. What is the option to set the localized texts to these tab titles now?
2. The tabs are now having the tooltip and how can I localize those tooltips on the tab titles?
3. I want the Existing Anchor label to be text wrapped to display the full text. in some languages it is too long and the text is currently showing only fixed lenght with 3 dots. But I want it to be displayed fully with text wrap. I tried the below, but it breaks the word in the middle. I only want to wrap by breaking by the white space and not the single word. Any workaround for this?
I appreciate your help!
<
td class="reLabelCell" style="word-wrap: break-word!important;">
You do not need any JavaScript code, because you can localize the Tabs inside the Link Manager through the provided resx localization of RadEditor. Just open the
\App_GlobalResources\RadEditor.Dialogs.resx file and modify the values of the following properties:
LinkManager_HyperlinkTab
LinkManager_EmailTab
LinkManager_AnchorTab
You can also increase the size of the tabs by modifying the LinkManager.ascx file and setting the Width properties to the different tabs:
<
telerik:RadTabStrip
ShowBaseLine
=
"true"
ID
=
"LinkManagerTab"
runat
=
"server"
SelectedIndex
=
"0"
MultiPageID
=
"dialogMultiPage"
>
<
Tabs
>
<
telerik:RadTab
Width
=
"130"
Text
=
"HyperlinkTab"
Value
=
"HyperlinkTab"
>
</
telerik:RadTab
>
<
telerik:RadTab
Width
=
"130"
Text
=
"AnchorTab"
Value
=
"AnchorTab"
>
</
telerik:RadTab
>
<
telerik:RadTab
Width
=
"130"
Text
=
"EmailTab"
Value
=
"EmailTab"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
Best regards,
Rumen
the Telerik team
Here is an example how to modify the text of the tabstrip tabs using the client side API of RadTabStrip, e.g.
<telerik:RadTabStrip ShowBaseLine=
"true"
ID=
"LinkManagerTab"
runat=
"server"
SelectedIndex=
"0"
MultiPageID=
"dialogMultiPage"
>
<Tabs>
<telerik:RadTab Text=
"HyperlinkTab"
Value=
"HyperlinkTab"
>
</telerik:RadTab>
<telerik:RadTab Text=
"AnchorTab"
Value=
"AnchorTab"
>
</telerik:RadTab>
<telerik:RadTab Text=
"EmailTab"
Value=
"EmailTab"
>
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<script type=
"text/javascript"
>
function
pageLoad() {
var
tabStrip = $find(
"LinkManagerTab"
);
tabStrip.findTabByValue(
"HyperlinkTab"
).set_text(
"testString"
);
tabStrip.findTabByValue(
"AnchorTab"
).set_text(
"testString"
);
tabStrip.findTabByValue(
"EmailTab"
).set_text(
"testString"
);
}
</script>
Another way is to modify the setupChildren function as follow:
this
._tab = $find(
"LinkManagerTab"
);
this
._tab.findTabByValue(
"HyperlinkTab"
).set_text(
"testString1"
);
this
._tab.findTabByValue(
"AnchorTab"
).set_text(
"testString1"
);
this
._tab.findTabByValue(
"EmailTab"
).set_text(
"testString1"
);
Regards,
Rumen
the Telerik team
var
tabStrip = $find("LinkManagerTab");
tabStrip.findTabByValue("HyperlinkTab").get_linkElement().title = hyperlinkText;
tabStrip.findTabByValue(
"AnchorTab").get_linkElement().title = anchorText;
tabStrip.findTabByValue(
"EmailTab").get_linkElement().title = emailText;
Any response for the my 3rd question? Here is the queiston that I have asked:
3. I want the Existing Anchor label to be text wrapped to display the full text. In some languages it is too long and the text is currently showing only fixed lenght with 3 dots. But I want it to be displayed fully with text wrap. I tried the below, but it breaks the word in the middle. I only want to wrap by breaking by the white space and not breatking the single word. Any workaround for this?
I appreciate your help!
<
td class="reLabelCell" style="word-wrap: break-word!important;">
Did you try to decrease the width size of the ExistingAnchor select dropdown and increase the size of the TD element in which is placed the label? The ellipsis effect is due to the following style text-overflow: ellipsis;.
This is a standard HTML content and you should be able to modify it to achieve your scenario.
If needed I could tell you how to increase the size of RadWindow based Link Manager dialog.
All the best,
Rumen
the Telerik team