Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
316 views
I don't see any built in client-side functionality to auto-resize a column in a RadTreelist like there is in the RadGrid. Could anyone provide a resource or code on how to accomplish this with my own function?

Here is the code I am using for a set width RadGrid to accomplish this. Essentially, it is auto-resizing all the columns then taking whatever is left over and adding it to the column of my choosing. I want to accomplish the same thing.

            function GridCreated(sender, args) {
                var grid = sender;
                var columns = grid.get_masterTableView().get_columns();
                var oldGridWidth = 0;
                var newGridWidth = 0;
                var primaryColumnIndex;

                for (var i = 0; i < columns.length; i++) {
                    oldGridWidth = oldGridWidth + columns[i].get_element().offsetWidth;
                    columns[i].resizeToFit();
                    newGridWidth = newGridWidth + columns[i].get_element().offsetWidth;
                    if (columns[i].get_uniqueName().charAt(0) == "*") {
                        primaryColumnIndex = i;
                    }
                }

                var varWidth = newGridWidth - oldGridWidth;
                var origWidth = columns[primaryColumnIndex].get_element().offsetWidth;
                grid.get_masterTableView().resizeColumn(primaryColumnIndex, origWidth - varWidth);
            }
Maria Ilieva
Telerik team
 answered on 02 Aug 2016
1 answer
219 views

We recently upgraded Sitecore to the 8.1 Update 3 version. With the upgrade path, the Telerik assembly was also updated. After the upgrade, we started receiving complaints about snippet formatting being changed when accepting the change. Below is a before and after view of the content.

Does anyone have any tips on a fix or what the next step should be? Thanks!

 

Example Snippet Code:

<!-- mug right -->
<div class="mug right">  <img alt="" width="80" height="106" src="~/media/14B3501FFB3A422C911BD4D43F35A44D.ashx" />
<p class="name"><strong>Name</strong></p>
</div>
<!-- /mug right -->

What it looks like after accepting:

...paragraph content ends here.</p>

<p class="BodyCxSpMiddle"><!-- mug right -->
<div class="mug right">  <img alt="" width="80" height="106" src="~/media/14B3501FFB3A422C911BD4D43F35A44D.ashx" />  </div>
</p>
<p class="name"><strong>Name</strong></p>
<p class="BodyCxSpMiddle">
<div class="mug right">&nbsp;</div>
<!-- /mug right --></p>

<p>Content starts back up...

Marin Bratanov
Telerik team
 answered on 02 Aug 2016
5 answers
112 views

Hello,

I've added some logic to the OnClientPasteHtml method in Javascript, which ensures that the <a> tag has a href of "#" and adds a OnClick attribute. We're doing this so that mailto links are (roughly) encoded, so bots do not spam the email address, etc.

This is my code:

 

function OnClientPasteHtml(sender, args) {
    var commandName = args.get_commandName();
    var value = args.get_value();

if (commandName == "LinkManager" || commandName == "SetLinkProperties") {
        breakme: if (/href="mailto:([^@]+)@([^?"]+)(?:\?subject=([^"]+))?[^>]+>([^<]+)/i.test(value)) {
            var valueSplit = value.match(/href="mailto:([^@]+)@([^?"]+)(?:\?subject=([^"]+))?[^>]+>([^<]+)/i);

            // Email address
            if (typeof valueSplit[1] == "undefined" || typeof valueSplit[2] == "undefined") {
                break breakme;
            }
            var addrPrefix = valueSplit[1];
            var addrSuffix = valueSplit[2];
            // Subject
            var subject = '';
            if (typeof valueSplit[3] !== "undefined") {
                subject = valueSplit[3];
            }
            // Text
            var linkText = '';
            if (typeof valueSplit[4] !== "undefined") {
                linkText = valueSplit[4];
            }

            // Final output example = <a onclick="href='mailto:'+'first.name'+'@'+'domain.com'+'?subject=hello world'" href="#">Email Me.</a>
            var valueFinal = '';
            if (Prototype.Browser.IE) {
                // TODO: Fix IE bug
            }
            else{
                valueFinal = "<a onclick=\"href='mailto:'+'" + addrPrefix + "'+'@'+'" + addrSuffix + "'+'?subject=" + subject + "'\" href=\"#\">" + linkText + "</a>";
            }
            args.set_value(valueFinal);
        }
}

 

It works perfectly, in Firefox, but I seem to be getting odd results in IE (and possibly Chrome).

When I debug in IE, I can see that valuFinal is in the correct format, but then when you click or view html, the <a> tag changes, to this:

<a onclick="href='mailto:'+'website'+'@'+'domain.com'+'?subject=domain.com feedback'" href="mailto:website@domain.com?subject=domain.com feedback">mailto:website@domain.com?subject=domain.com feedback</a>

As you can see, the href is not a "#" and the link text is being replaced by the same mailto link.

 

I use Sitecore.NET 7.2 (rev. 140526), which is using Telerik 2012.1.607.35 DLL version.

We don't really want to upgrade any versions so a fix for my current state will be ideal.

Any information will be great! Thanks :)

Marin Bratanov
Telerik team
 answered on 02 Aug 2016
1 answer
171 views

Hi, I am testing a bug on your online Demo of the Editor - Track Changes and if :

1) I bold a non tracked word

2) I Append an "s" to the previous non tracked word

3) delete the space between the previous word and the bolded word

the tracking will delete the first letter of the bolded word? We have clients that have complained about it.

They had a non tracked phrase "total income (1)" and they added an "s" to income and then deleted the space but the "(" ended up being strikedthrough.

Symon

Nikolay
Telerik team
 answered on 02 Aug 2016
0 answers
171 views

Hi,

I am working on Telerik Radeditor with Markdown mode. But when I underline the text then it does not work.

Is there any way to support the underlining in markdown mode? Below is the example which I am referring for the implementation of Markdown mode.

http://demos.telerik.com/aspnet-ajax/editor/examples/import-export/markdown-import-export/defaultcs.aspx

Please help me ASAP.

 

Thanks in advance.

Avinash
Top achievements
Rank 1
 asked on 02 Aug 2016
1 answer
363 views
Is there a way to via server-side or client side to freeze the top row of headers?
Ivan Danchev
Telerik team
 answered on 02 Aug 2016
1 answer
145 views

Hi, if I open a RadDropDownTree and then I press enter to automatically select all the items.

 

                                                    <telerik:RadDropDownTree RenderMode="Lightweight" ID="RadDropDownTree3" runat="server" Width="100%" CheckBoxes="TriState"
                                                        DefaultMessage="Seleziona la zona" OnNodeDataBound="RadDropDownTree1_NodeDataBound" Skin="Bootstrap" >
                                                        <DropDownSettings />
                                                    </telerik:RadDropDownTree>

 

You can avoid this behavior ?

Veselin Tsvetanov
Telerik team
 answered on 02 Aug 2016
1 answer
178 views

I want to access UserControl element ex: textbox, checkbox, combobox...etc on ItemCommand event. I found some topic say can't do it. But, I hope someone can solve this. Thank all!

P/s: I have 4 button with custom command in usercontrol edit form. ItemCommand can do command, but can't access UserControl to retrieve value from control in it.

Eyup
Telerik team
 answered on 02 Aug 2016
1 answer
535 views
I've got a RadGrid with programmatically generated columns, including a variable number of column groups.
 Each of the column groups contains two/three columns, and I want to hide the columns along with the associated ColumnGroup.
Above the RadGrid I have a series of checkboxes, one for each column group. The goal is to have the user
 check or uncheck the boxes depending on what columns they wish to see. Currently I am setting the columns
' Display properties when a checkbox's checked value is changed by using 
radgrid.Columns.FindByUniqueName("columnName").Display.

And also tried radgrid.MasterTableView.ColumnGroups.FindGroupByName("colGroupname").Display = False but there is no 
Display property for that and the Visible property is ReadOnly. So I managed to hide ColumnGroup by applying
CSS class to hide the Column group.

But the export to excel is not reflecting the hidden group and also it reshuffles the columns into excel file.
So please suggest the option to hide the Column group into export file or any alternate option to achieve the same.
Eyup
Telerik team
 answered on 02 Aug 2016
1 answer
176 views

Hi,

 

I see this happening.

Markup is shown properly in the HTML view of the RadEditor, but is stripped when rendered on the page.

Here is my HTML as shown in the RadEditor:

<p><img alt="the other" src="/PublishingImages/Signing-4730x.jpg" /></p

Note the end tags on IMG when the page is rendered I get this:
<p><img alt="the other" src="/PublishingImages/Signing-4730x.jpg"></p>

 

Also see this old post from 2009

Is this issue still applicable on the latest version of the RADEditor?

 

Ps. I know the <img> tag is a self closing tag, so the latter html is still valid. see here

 

Thanks!

Regards,

John

Ianko
Telerik team
 answered on 02 Aug 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?